Display 24-bit image???

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Jolly Joker
Posts: 23
Joined: Fri Jul 13, 2007 6:08 pm

Display 24-bit image???

Post by Jolly Joker »

I add a picture using this code:

Code: Select all

device.GUIEnvironment.AddImage(device.VideoDriver.GetTexture("media/bg.png"), new Position2D(0, 0), false, null, -1, "");
and this is what I receive:
Image
This is how the original picture looks like:
Image

Note: I run the device in 32-bit mode, but the picture seems to be displayed only in 16-bit :?

How can I fix this?
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Maybe you can save it as 32-bit? 24bit is really not recommended as hardware support is random and sometimes limited.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Jolly Joker
Posts: 23
Joined: Fri Jul 13, 2007 6:08 pm

Post by Jolly Joker »

Thanks for your quick reply :wink: Let me try saving the picture in 32-bit mode :)

Edit: Well it doesn't even display the picture :cry:
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

For a start you want to have the image in dimensions of 2^n (eg 16, 32, 64, 128, 256, 512 etc) otherwise the picture gets distorted a bit. Not sure if that's what is causing your problem but it's something to bear in mind and possibly try out.
Image Image Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Did you try D3D and OpenGL driver? which version of Irrlicht are you using? Maybe you can upload the two png files for me to check. I thought that PNG was properly supported now.
Jolly Joker
Posts: 23
Joined: Fri Jul 13, 2007 6:08 pm

Post by Jolly Joker »

I forgot to tell that the dimensions are not changed, 2 images that I uploaded are just parts of the picture :oops: The problem is the image is 24-bit but rendered like 16-bit.

@Hybrid: I use Software renderer. If I switch to OpenGL or D3D the image displays well without problem. But this is the background image for a menu, in this menu, user will choose which driver to use :P That's why I need a solution for software renderer :P
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I think that's just what you get with the software renderer. It's crap :lol:
Image Image Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The software renderer is fixed 16bit, you can use the burning video renderer which is 32bit capable and does not require hardware support.
Post Reply