There are 2 solutions :-Solution 1
1) create the source image. (Image.createImage(...).
1) use Image.getRGB(...) to get the pixels from the source image.
2) scale the RGB pixel array using what-ever scaling algorithm you wish (this is not a J2ME problem)
3) pass the scaled pixels into Image.createRGBImage(...)
Be warned, a significant number of handsets have faulty implementations of Image.getRGB(...), and there are likely some with faulty Image.createRGBImage(...) implementations too.
However, this is the simpler of the 2 solutions.Solution 2
1) Grab the pixel data directly from the raw png data.
2) Scale the pixel data using what-ever scaling algorithm you wish (this is not a J2ME problem)
3) regenerate the necessary png wrapper structure.
3) create the image.
This solution will work on both MIDP1 & 2.
You will need to ensure your source png images store their IDAT chunk uncompressed. (unless you want to write a zlib decompressor too!)
Also, depending on the scaling algorithm you choose for part 2, you may want to impose some restrictions on the color type & bitdepth used in the source image)
You will need to examine the following specifications :-
a) PNG file format specification ( http://www.w3.org/TR/PNG/
b) RFC 1950 - ZLIB specification ( http://www.faqs.org/rfcs/rfc1950.html
c) RFC 1951 - Deflate specification ( http://www.faqs.org/rfcs/rfc1951.html