Date: Tue, 07 Sep 2004 23:37:55 +0200 From: Hinko Kocevar Subject: Re: [nanogui] white color in images - SOLVED Hinko Kocevar wrote: > Hi, > > I have some strange effects while trying to display 16-bit color PNG > image on my embedded target. All colors are fine execept for white - it > is displayed as black instead. White shades to some extent are also > displayed black. > > I using FLTK 1.1.4 on top of mw-0.90 and nxlib-0.45 on 16bpp display. > Widgets can use white normally, problem exists only for images. > > Has anyone also experienced this? > > regards, > h > I was pursuing this problem these days and as it turned out there is a problem with creating graphic context if no valuemask is set, eg. for pixmap. I solved it by replacing folowing lines in CrGC.c, nxlib-045: /* X11 defaults to fg=black, bg=white, NX is opposite...*/ if (!(valuemask & GCForeground)) XSetForeground(dpy, gc, 0L); /* black*/ if (!(valuemask & GCBackground)) XSetBackground(dpy, gc, ~0L); /* white*/ with these /* X11 defaults to fg=black, bg=white, NX is opposite...*/ if (!(valuemask & GCForeground)) XSetForeground(dpy, gc, 0L); /* black*/ if (!(valuemask & GCBackground)) XSetBackground(dpy, gc, 0xffff0000); /* white*/ It is working for me. Further I tested with using XSetForeground(dpy, gc, 0xffffffff) and XSetBackground(dpy, gc, 0xff000000) and it also works here. It looks like the values have to be swapped, despite the comment above. regards, h -- hinko kocevar iskramedical si Hinko Kocevar, developer Iskra Medical d.o.o., Stegne 23, 1k LJ, SLO-EU "Aì rén" | [Analects XII:22] --------------------------------------------------------------------- To unsubscribe, e-mail: nanogui-unsubscribe@linuxhacker.org For additional commands, e-mail: nanogui-help@linuxhacker.org