nanogui: PNG and transparency


Previous by date: 28 Jul 2009 10:27:33 -0000 Re: Problem with focus on different windows, Greg Haerr
Next by date: 28 Jul 2009 10:27:33 -0000 nano-X libpng : read a png image crash nano-X on a arm target (but work well on host x86), BRACH Vincent
Previous in thread: 28 Jul 2009 10:27:33 -0000 Re: PNG and transparency, BRACH Vincent
Next in thread: 28 Jul 2009 10:27:33 -0000 Re: PNG and transparency, Bajimohanreddy Bandi

Subject: Re: [nanogui] PNG and transparency
From: "Greg Haerr" ####@####.####
Date: 28 Jul 2009 10:27:33 -0000
Message-Id: <05ea01ca0f22$8b72ed30$6464a8c0@winXP>

: I try to draw transparency PNG images in my nano-X application but all
: the time the transparency's part of it is displayed in black..

Make sure you're using the CVS code, as there were earlier bugs
in transparency. v0.90 is definitely buggy.


: I tried to display it on an window created by
: GrNewWindow(GR_ROOT_WINDOW_ID, 0, 0, 480, 640, 0, WHITE, BLACK);

Using BLACK here is a bad idea, as you can't tell whether the
transparency is being drawn BLACK, or whether BLACK is
showing through.

I don't have the source code handy, but each image decoder
handles transparency differently.  I know we support GIF transparency,
I'm not sure whether PNG was added.  And below you're
saying the .xpm works.  You can check the source
looking for ".transcolor" or "->transcolor" being set
to something other than NOCOLOR.  The decoders then
don't draw a pixel when the image color matches transcolor.


: 
: I tried with GrLoadImageFromFile plus GrDrawImageToFit and with
: GrDrawImageFromFile too, and same result.

Yes, each of these use the same decoder, depending on image type.

Regards,

Greg





: When I convert this image in .xpm and use the same code (just changing
: th extension of the file to load) everything gonna be ok.
: 
: Can anybody help me please ?
: 
: Regards,
: 
: Vincent BRACH
: 
: 
: 
: 
: 
: 
:

Previous by date: 28 Jul 2009 10:27:33 -0000 Re: Problem with focus on different windows, Greg Haerr
Next by date: 28 Jul 2009 10:27:33 -0000 nano-X libpng : read a png image crash nano-X on a arm target (but work well on host x86), BRACH Vincent
Previous in thread: 28 Jul 2009 10:27:33 -0000 Re: PNG and transparency, BRACH Vincent
Next in thread: 28 Jul 2009 10:27:33 -0000 Re: PNG and transparency, Bajimohanreddy Bandi


Powered by ezmlm-browse 0.20.