For creating Facebook App, we need Icons and banners for the app with defined sizes. At the time of development ,we don't concentrate on Icons and Banners design. At the starting stage we need rough Icons and Banners. If you are a java developer you can create these Icons and Banners in a minute. You can find the basic Idea of this app at http://blog.sodhanalibrary.com/2014/09/create-phonegapcordova-icons-and.html

Java Library :

For quality image scaling, I have used java-image-scaling library.

Java Program to create icons :

Replace destinationDir with your own destination directory Path
Replace appIcon with your own app icon Path
Add dimension of the Icon you want to dimensions
Run this program
Find destination path for new Icons
import java.awt.Dimension;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import javax.imageio.ImageIO;
import com.mortennobel.imagescaling.ResampleOp;

public class CreateFbAppIcons {
  static String destinationDir = "C:\\fbIcons";
  static String appIcon = "C:\\icon.png";
  static ArrayList<Dimension> dimensions = new ArrayList<Dimension>();
  
  public static void main(String[] args) throws IOException {
      dimensions.add(new Dimension(1024,1024));
      dimensions.add(new Dimension(16,16));
      readFile(destinationDir);
  }
  
    public static void readFile(String path) throws IOException {
        File destDir = new File(destinationDir);
        if(!destDir.exists()) {
            destDir.mkdirs();
        }
        BufferedImage appIconImg = ImageIO.read(new File(appIcon));
        for(Dimension dim : dimensions) {
            String destFilePath = destinationDir+"\\icon"+(int)dim.getWidth()+"X"+(int)dim.getHeight()+".png";
            File destFile = new File(destFilePath);
            if(!destFile.exists()) {
                  destFile.createNewFile();
            }
            System.out.println("File "+ destFile.getAbsolutePath());
            ResampleOp resampleOp = new ResampleOp((int)dim.getWidth(),(int)dim.getHeight());
            BufferedImage generatedIcon = resampleOp.filter(appIconImg, null);
            ImageIO.write(generatedIcon, "png", destFile);  
        }
    } 
  
}

Java Program to Create Banners :

Run this program
Find destination path for new Banners
If you want any banner with specific size then you can add those dimension to dimensions
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import javax.imageio.ImageIO;
import com.mortennobel.imagescaling.ResampleOp;

public class CreateFbBanners {
  static String destinationDir = "C:\\fbIcons";
  static String appIcon = "C:\\icon.png";
  static ArrayList<Dimension> dimensions = new ArrayList<Dimension>();
  
  public static void main(String[] args) throws IOException {
      dimensions.add(new Dimension(800,150));
      dimensions.add(new Dimension(1200,627));
      dimensions.add(new Dimension(1848,682));
      dimensions.add(new Dimension(155,100));
      readFile(destinationDir);
  }
  
    public static void readFile(String path) throws IOException {
        File dir = new File(destinationDir);
        if(!dir.exists()) {
            dir.mkdirs();
        }
        BufferedImage appIconImg = ImageIO.read(new File(appIcon));
        for(Dimension dim : dimensions) {
            String destFilePath = destinationDir+"\\icon"+(int)dim.getWidth()+"X"+(int)dim.getHeight()+".png";
            File destFile = new File(destFilePath);
            if(!destFile.exists()) {
                  destFile.createNewFile();
            }
            System.out.println("File "+ destFile.getAbsolutePath());
            ImageIO.write(createScreenImage(appIconImg,(int)dim.getWidth(),(int)dim.getHeight()), "png", destFile); 
        }
    } 
    
      private static BufferedImage createScreenImage(BufferedImage appIconImg, int width, int height) throws IOException {
          int type = appIconImg.getType() == 0? BufferedImage.TYPE_INT_ARGB : appIconImg.getType();
          BufferedImage newPGScreen = new BufferedImage(width, height, type);
          Graphics2D g = newPGScreen.createGraphics();
          g.setColor(new Color(255,255,255));
          g.fillRect(0, 0, width, height);
          double minSize = 0, tw = (double)width, th = (double)height;
          if(tw < th) {
              minSize = tw;
          } else {
              minSize = th;
          }
          minSize = minSize / 4;
          ResampleOp  resampleOp = new ResampleOp((int)(minSize*2), (int)(minSize*2));
          BufferedImage resizedIcon = resampleOp.filter(appIconImg, null);
          g.drawImage(resizedIcon, (int)((tw/2) - minSize), (int)((th/2) - minSize) , null);
          g.dispose();
          return newPGScreen;
      }

}

51 comments:

  1. Replies
    1. Nice article. All the sections of your site covered with great functions. I really like the content and discussions on your site. Thanks a lot for allowing me to join. I love to see more about GB WhatsApp. Keep sharing and updating. Also share more posts with us. Thank you.

      Delete



  2. Wonderful information! I found amazing information on the blogs i suggest everyone to follow the links below to get download files from this website.

    gbwhatsapp apk
    acmarket apk
    freedom apk
    live nettv apk
    aptoide apk

    ReplyDelete
  3. If you are looking for the best data provider then we are providing you the best database or business directory. If you want, we can help each other in the process process or searching for sales automation tool then we can also help you here also to provide marketing automation companies.

    ReplyDelete
  4. Thanks for the detailed information about this. I would love to see more such awesome blog posts from you. Keep up the Good Work! Thats why I love Gbwhatsapp, It has a lot of awesome features.

    ReplyDelete
  5. If you are interested in then we can provide you thewhat is crm and database marketing
    We also provide to help you in company database
    We also provide business data and crm software details.

    ReplyDelete
  6. Oh boy these banners and icons are just OP. Thank alot for sharing this. Also check out Nulled WP Plugins 2021, clash of clans MOD APK 2021, and MODSDROID

    ReplyDelete
  7. Good blog. Keep sharing. I love them Are you also searching for Cheap Essay24/7? we are the best solution for you. We are best known for delivering cheap essays to students without having to break the bank

    ReplyDelete
  8. I love it here. Keep sharing your good vibes. I love them Are you also searching for assignment help UK? we are the best solution for you. We are best known for delivering cheap assignments to students without having to break the bank

    ReplyDelete
  9. In general, we can see that most of the people are struggling to find the stuffs when you want to know. If you are looking for the same, then without going for a second thought, go ahead with this- Check new posts- fmwhatsapp and gbwhatsapp

    ReplyDelete
  10. Hey, thank you a lot for sharing this article with us. I can’t say, how grateful we are to read this. Also, I would love to share it with my friends and family, who are interested. I hope you will publish such articles in the future as well. It’s so helpful. Goodbye! Download KineMaster Mods

    ReplyDelete
  11. Thanks for the detailed article on this topic. I would like to see more such awesome articles from you. Download GBWhatsApp APK

    ReplyDelete
  12. Thanks for sharing this valuable piece of information. Keep sharing more such awesome articles in the future. Goodbye! Download FMWhatsApp APK

    ReplyDelete
  13. Excellent blog, I loved it so much that I came back here to give feedback. Thanks though. Also download COC MOD Apk.

    ReplyDelete
  14. This was an excellent article. Thank you for sharing it.
    Xilisoft Video Splitter

    ReplyDelete


  15. I hope this post is beneficial for viewers. Many thanks for the shared this informative and interesting post with us.
    plagiarism-checker-x

    ReplyDelete
  16. I am very impressed with your post, thanks for sharing. Would love to see more stuff like this in future. Also download Lulubox Apk.

    ReplyDelete
  17. Thanks for the detailed article on this topic. I would like to see more such awesome articles from you. Also you can get the new and best features of GBWhatsapp which are coming in 2022- GBWhatsapp 2022 APK

    ReplyDelete
  18. Thanks for the detailed article on this topic. I would like to see more such awesome articles from you.FMWhatsapp APK

    ReplyDelete
    Replies
    1. Yes brother FMWhatsapp is more better than the original, I'm also using it. Thank you!

      Delete
  19. Thanks for the detailed article on this topic. I would like to see more such awesome articles from you. Also you can get the new and best features of FMWhatsapp which are coming in 2022-


    FMWhatsapp APK

    ReplyDelete
  20. That's an outstanding piece of work!I look forward to seeing more!I am very impressed form it.
    avira phantom vpn crack


    ReplyDelete

  21. hello sir,Really amazing work keep doing and keep spreading the information , like your post .remove logo now 2.0 crack

    ReplyDelete
  22. I am very impressed with your post because this post is very beneficial for me and provide a new knowledge… clean my mac high sierra crack

    ReplyDelete
  23. duplicate cleaner 4 license key amazed at how much the Cleaner Pro License key can
    ignore you in a file of unnecessary or forged documents.

    ReplyDelete
  24. The article you wrote is excellent. Thanks for providing such an informative website. If you are working on something, please keep us informed.
    FileBot Crack

    ReplyDelete
  25. Thanks for Sharing such an amazing article. Keep working... Your Site is very nice, and it's very helping us.. this post is unique and interesting, thank you for sharing this awesome information Abbyy Finereader Crack

    ReplyDelete
  26. I am very lucky to have been able to visit your blog and learn about such an intriguing topic
    topic
    So I will bookmark this page so that I can come back to it in the future.
    FullKeygens

    ReplyDelete
  27. Your post is based on the informative things. This is very informative for me and i think, your post is also informative for the world. Keep on hardworking if you want to progress in the future. Thanks again for the great post.
    freekeyspro

    ReplyDelete
  28. Such a great information for blogger i am a professional blogger thanks crack-softs.com

    ReplyDelete
  29. An informative and knowledgeable site.
    I really appreciate the article you shared with us.
    artensoft photo collage maker

    ReplyDelete

  30. hi sir,Found your post interesting to read. I cant wait to see your post soon. Good Luck for the upcoming update.This article is really very interesting and effective thank you.
    kmsauto net windows 8.1 activator

    ReplyDelete
  31. Wonderful work! This is the kind of info that are meant to be shared across the internet. Disgrace on the search engines for not positioning this post higher! Come on over and consult with my website. avg antivirus activation code

    ReplyDelete
  32. Hello Dear thanks For Sharing Such A Greate content with Us, Its really an amazing Information so please keep sharing. I also Have something special for you so please check out

    adobe photoshop cs6 crack dll files 32bit 64bit download
    avast anti track premium full
    proshow producer crack

    ReplyDelete
  33. Such a great information for blogger i am a professional blogger thanks softwareeagle.com

    ReplyDelete

  34. Thanks for this informative blog and for giving us an opportunity to share our views.
    IDM Crack
    iBackupBot Full Crack
    KMSAuto Net

    ReplyDelete
  35. Hello, Dear Thanks for sharing such great content with the US it’s really amazing content so please keep sharing. I also have something for you so please check out
    Luminar Neo Ios Torrent Mac
    Luminar AI Ios Mac Torrent

    ReplyDelete
  36. In the game, players participate in illegal street races that focus on different racing styles, using a variety of real-world licensed cars (available at the time of game development and launch) that can be updated and customized with new pieces. while facing the involvement of the police in their efforts to prevent the player. Racing events focus on competitive races with other drivers on point-to-point circuits or routes, checkpoint races and races PES 2016 download Miracle Box Cracked m3 data recovery crack vray crack freemake video converter crack key Crime Korean Drama primocache crack icloud remover crack planswift crack Connectify Hotspot Cracksprints or drifts (the latter absent in its predecessor), with players able to use Nitrogen oxide and Speedbreaker when needed. either to help win the race, or to get out of difficult situations that recharge over time. The game itself features four game modes: Race, Quick Race, Challenge Series and Multiplayer, the latter offering online play available on all console and PC versions of the game, except the Wii edition.

    ReplyDelete
  37. You must be known about WhatsApp mods, but most of the mods are just made for small purpose use. But FMWhatsApp is one of the best.

    ReplyDelete

Blogroll

Popular Posts