Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to scale an image?  RSS feed

 
Usama Rashwan
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to scale an image to be small so that i can display it as an icon, how i can perform that?
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look up the API for java.awt.image.RescaleOP. Your source and destination must be BufferedImages. You will probably have to do something like this:

The null is for the java.awt.RenderingHints which I don't know much about. You will have to make a colorModal, but you can get that from source.getColorModal();
Steve
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!