nanogui: Re: white color in images - SOLVED


Previous by date: 7 Sep 2004 22:37:58 +0100 MicroWindows and freetype-2.1.9 ???, Steven Scholz
Next by date: 7 Sep 2004 22:37:58 +0100 How to install microwindows-0.89pre8 on power PC plotform, manyam svvvprasad
Previous in thread:
Next in thread: 7 Sep 2004 22:37:58 +0100 Re: white color in images - SOLVED, Greg Haerr

Subject: Re: [nanogui] white color in images - SOLVED
From: Hinko Kocevar ####@####.####
Date: 7 Sep 2004 22:37:58 +0100
Message-Id: <413E2A33.3010804@iskramedical.si>

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 <dot> kocevar <at> iskramedical <dot> si
Hinko Kocevar, developer
Iskra Medical d.o.o., Stegne 23, 1k LJ, SLO-EU

	"Aì rén"	|	[Analects XII:22]

Previous by date: 7 Sep 2004 22:37:58 +0100 MicroWindows and freetype-2.1.9 ???, Steven Scholz
Next by date: 7 Sep 2004 22:37:58 +0100 How to install microwindows-0.89pre8 on power PC plotform, manyam svvvprasad
Previous in thread:
Next in thread: 7 Sep 2004 22:37:58 +0100 Re: white color in images - SOLVED, Greg Haerr


Powered by ezmlm-browse 0.20.