Small fix in case of desktop icon without image.

Rootpmap accepts now works for 16/24 bit displays with 16/24/32 bit images.
This commit is contained in:
Sanel Zukan
2007-06-22 09:43:15 +00:00
parent d91784d0de
commit f006fb0d0f
5 changed files with 225 additions and 64 deletions

View File

@ -310,21 +310,22 @@ Pixmap create_mask(Fl_Image* img) {
}
const char* src = img->data()[0];
unsigned char r,g,b,a;
unsigned char a;
for(int y = 0; y < ih; y++) {
for(int x = 0; x < iw; x++) {
r = *src++;
g = *src++;
b = *src++;
// jump rgb and pick alpha
src += 3;
a = *src++;
//EDEBUG("x: %i y: %i\n", x, y);
if(a < 128)
if(a < 128) {
// these are transparent
XPutPixel(xim, x, y, 0);
else
}
else {
// these are opaque
XPutPixel(xim, x, y, 1);
}
}
}