Hi,
Can someone tell me what is going wrong here? I wish to have a 32 bit
RGBA 8888 png that I can use for some opengl multitexturing work, but
I am always missing the alpha channel eg
//save a jpg as a png
wxImage test1( "c:/existing_file.jpg" );
test1.SaveFile( "c:/test1.png" );
//add alpha to the png and save it out
wxImage test2( "c:/test1.png" );
test2.InitAlpha();
test2.SaveFile( "c:/test2.png" );
if ( test2.HasAlpha() )
{
//it enters here ok
int i = 0;
}
//test that the saved file has alpha
wxImage test3( "c:/test2.png" );
if ( test3.HasAlpha() )
{
//it doesn't enter here
int i = 0;
}
I don't get why it doesn't enter the second if statement.
Alternatively, can someone tell me how to create a 32 bit RGBA 8888
png from either Photoshop or Gimp? Every time I try to create one in
either of these applications, I would read the png file into wxWidgets
and I would always get told that it has no alpha in it. An artist I am
not :)
Thanks for any help,
Patrick
PS> Can someone tell me what is going wrong here? I wish to have a 32 bit
PS> RGBA 8888 png
Sorry, what do you mean by this ("8888")?
PS> I am always missing the alpha channel eg
PS>
PS> //save a jpg as a png
PS>
PS> wxImage test1( "c:/existing_file.jpg" );
PS> test1.SaveFile( "c:/test1.png" );
PS>
PS> //add alpha to the png and save it out
PS>
PS> wxImage test2( "c:/test1.png" );
PS> test2.InitAlpha();
PS> test2.SaveFile( "c:/test2.png" );
This is not enough, the saved PNG won't have any alpha channel data if all
pixels are opaque. Try really making some pixels (even one would be enough)
[semi-]transparent.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-u...@lists.wxwidgets.org
> For additional commands, e-mail: wx-use...@lists.wxwidgets.org
>
>