2D Image rendering problem (addImage)

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
khamill
Posts: 17
Joined: Thu Mar 08, 2007 3:50 pm
Location: Nova Scotia, Canada

2D Image rendering problem (addImage)

Post by khamill »

Hi Guys,

I'm putting an image in 2d at the top of a Irrlicht device window. Here is where I create the device:

video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;

device = createDevice(driverType, core::dimension2d<s32>(800, 600));

I'm using virtual IGUIImage* irr::gui::IGUIEnvironment::addImage method

Here is my code to add the image:

img2 = env->addImage(driver->getTexture("../images/logo.jpg"), core::position2d<int>(100,0));

This is a .jpg file, but I've also tried a .bmp file as the image. No difference.

Problem:

The image looks great in Paint Shop Pro 7 create as a 800 X 188 pixel drawing with 16 million colors.

When I load the same image with the above code onto the Irrlicht window, the large letters (72 pt) become jagged and the whole image doesn't look so good. It looks somewhat blocky with a low resolution.

Is the a # of colors problem? What could it be?

thanks

Kevin
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You should use proper texture sizes, i.e. power-of-two dimensions.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

I think it's a dimension problem... ;)
Use dimensions in power of 2 !!!
1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024,...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
khamill
Posts: 17
Joined: Thu Mar 08, 2007 3:50 pm
Location: Nova Scotia, Canada

Post by khamill »

Yep, it was a dimemsion problem.

When I resized the image to 512 X 128 and displayed it again, it looks perfect.

thanks for the quick response.

I think that one took 5 minutes to get an answer. Wow!

thanks again

Kevin
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

A search on the forum would propably be even faster... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Post Reply