Given the width, height, depth and array of bytes of the image, I need to create a SWT image object. I currently have no problem providing data for 8-bit images.
int imageWidth;
int imageHeight;
int depth;
byte[] imageBytes;
imageData = new ImageData( imageWidth, imageHeight, depth, new PaletteData(255,255,255), 1, imageBytes);
new Image( display, imageData );
The problem is that for 16-bit images, the color is off a bit. What should be the black pixels are actually gray.
For 32-bit images, only a few black pixels are displayed, and the rest of the image is white.
Any ideas?
Thank.
Edit: the imageBytes array is read from a proprietary image file that I could not get for the specification (and therefore I'm not quite sure about the format).
32- . , 32- RGBAX. 24- , , 16- ( ).
imageBytes ( * * (/8)), .
, . , , , , , .