png transparency not working?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

User avatar
jed
Just popping in
Just popping in
Posts: 14
Joined: Fri May 20, 2005 14:51

png transparency not working?

Postby jed » Sat Apr 14, 2007 17:46

Hi I'm loading an imageset that uses a png file. I'm using it as a sprite essentially so I don't want it drawn as a simple square. The png has transparency turned on. the png shows up with the correct transparency in photoshop.
I call Image::draw()
the image appears but rather than the area marked transparent being see through it is white. Do I need to do something other than call Image::draw to get it to work correctly?

User avatar
jed
Just popping in
Just popping in
Posts: 14
Joined: Fri May 20, 2005 14:51

Postby jed » Tue Apr 17, 2007 17:26

Transparency doesn't seem to work with gifs either.

Here is a simple example:

Code: Select all

CEGUI::Imageset* unitImages=CEGUI::ImagesetManager::getSingleton().createImageset("units.imageset");

MouseCursor::getSingleton().setImage("units","cursor");


The cursor becomes a white block with the image. Do I need to call something else?

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Wed Apr 18, 2007 14:36

Strange, as for me it seems to work (drawing transparent png's). You could try to display that image in a StaticImage to see if it's CEGUI having problem with your image or your drawing code having problems.

User avatar
Levia
Quite a regular
Quite a regular
Posts: 83
Joined: Mon May 22, 2006 18:25
Location: Bergen op zoom, The Netherlands
Contact:

Postby Levia » Wed Apr 18, 2007 14:47

There are more people having the problem that their images are showing up white. Wonder what it is.
Image
Image

User avatar
jed
Just popping in
Just popping in
Posts: 14
Joined: Fri May 20, 2005 14:51

Postby jed » Wed Apr 18, 2007 15:37

StaticImage doesn't work either. The png is definitely transparent, it works fine in a webpage. Do you think it needs a specific bit depth of png? Could someone send me a png that works for them?

Also I just tried it as a .tga and it works fine.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Thu Apr 19, 2007 21:41

Ok, it's sure that it is the png file. This picture works for me.

MattyBoy
Just popping in
Just popping in
Posts: 2
Joined: Mon Apr 09, 2007 18:43

PNG and Transparent

Postby MattyBoy » Tue May 29, 2007 03:32

I have the same problem. Does anyone have any ideas?? I have also tried the suggestion from this thread.

[url]http://www.cegui.org.uk/phpBB2/viewtopic.php?t=1814&highlight=png+transparent
[/url]

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Tue May 29, 2007 11:16

Witch renderer do you use ? Witch image loader library do you use ?
Do you also have the same problem with the TaharezLook.tga file ?

MattyBoy
Just popping in
Just popping in
Posts: 2
Joined: Mon Apr 09, 2007 18:43

Postby MattyBoy » Wed May 30, 2007 07:16

Ogre Renderer - Found out it just uses Built in D3D file loading. The problem was something else un-related. Thanks.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 17 guests