Read pixels from image for last column
I've an interesting problem.
I've an image (PNG) with size 100x200, and I want to display it in 150X200.
So 50X200 area I've to fill with background based on image.
I want to use simple mechanism for that.
Take pixels from last column of image and pixels with interval 10.
i.e in above case i'll get 20 samples (100,0), (100,10)... (100,200).
Background color is calculated by taking average of Red, Green and blue of each sample.
Note: I've constraint to use subset of jdk-1.4 (J2ME with PBP 1.1).
I saw Bufferedimage & ColorModel APIs, but didn't get clear idea how it can be done.
Please give your valuable input.
Re: Read pixels from image for last column
There are methods that do image resizing for you.
What have you tried? The BufferedImage class has a getRGB() method, so you can do whatever you want. What have you tried?