I have never used this, though I did look at it a while ago. The interface is slightly different to MIDP-2 standards, but it is not complicated.
Essentially, you need four byte arrays, one for each channel red, green, blue and alpha. ("Alpha" is "opacity" (how opaque, 0 = transparent, 255 = fully opaque).)
You convert these byte arrays into a png:
Code:
byte[] pngData = gfx.toPNG(width, height, alpha, red, green, blue);
where: width and height are integers, the dimensions of the image in pixels, and alpha, red, green and blue are byte[] (all of the same size, which must be width*height, one value for each pixel).
Graham.