Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Problem with 1bit color depth on WinCE

Hi,
 
I'm trying to paint on an image with 1bit depth (see code below). Running on Win32 my code creates the image as excpected but when I use it on WinCE, the resulting bitmap is courrpt, viz. it's totaly black when i open it with an editor (but on win32 with the same code, i can see my graphic). And if I don't use a direct palette, everything works fine, but my image has a color depth of 16bit.
It looks like a WinCE (v4.1) or SWT (v3346) bug for me, so is there any other possibility to set the color depth of an image with SWT?
 
best regards
Andreas

// create image wit 1bit color depth  
PaletteData paletteData = new PaletteData(new RGB[] {new        
RGB(255,255,255),new RGB(0,0,0)});
ImageData imageData = new ImageData(100,100,1,paletteData);
Image image = new Image(display, imageData);

// paint on image (black and white lines experimental)


// save imag 
ImageLoader loader = new ImageLoader();
loader.data = "" ImageData[]{imageData};
loader.save(fileName, SWT.IMAGE_BMP);


Back to the top