• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to resize an image, where extra space is filled with a background color

 
Jesus Angeles
Ranch Hand
Posts: 2069
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For example, I want to resize an image with size 3 x 5 pixels, to 10 by 15, keeping the ratio.

To keep the ratio, the result is 9 x 15. There is a 1 pixel area that I want to fill with, say, white color.

Do you have an idea how it is done?
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't this actually the same problem as this one? If so, please Use One Thread Per Question.

The code I've added in that post shows how to create a new image. All you need to do is first fill it with white:
I'm sure that you'll be able to fill in the blanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!