Rescale 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
bdpdonp
Posts: 68
Joined: Sat Oct 10, 2009 6:35 am

Rescale Image

Post by bdpdonp »

I am working with larger 2D images (textures) that will be used for a splash-screen and throughout other areas. I intend to allow changing resolution to ones I specified. I would like to rescale the imaged down, for example a large 4:3 2D image, and scale it down to maybe 1024*768.

Is there any way to do this in irrlicht? I have read the forums and the last discussion seems to be 3 years ago. The methods I have tried only appear to crop the image, not reduce the size.

I have thought about GDI+ as it seems to be straightforward and stores the image in a raw format, but would need to find a way to load this bitmap in memory to irrlicht.

I have looked at other 3rd party libraries but I would have the same issue.

Any suggestions?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Rescale Image

Post by hendu »

The draw2DImage method with dest rect can do scaling.
Mel
Competition winner
Posts: 2293
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Rescale Image

Post by Mel »

Also, take a look at this snippet, it allows to draw many fragments of one texture into another texture with diferent scales, maybe it serves you, because, instead of performing a draw call once for each image you want, it draws all the images at once.


http://irrlicht.sourceforge.net/forum/v ... 5&p=224457
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
bdpdonp
Posts: 68
Joined: Sat Oct 10, 2009 6:35 am

Re: Rescale Image

Post by bdpdonp »

Thanks. Works well.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Rescale Image

Post by hendu »

Why is that not yet integrated.
Mel
Competition winner
Posts: 2293
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Rescale Image

Post by Mel »

It is DX only. Though I think it is posible to build that utility over the code of Irrlicht.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Post Reply