Hi!
Is it possible to resize image or a texture? I tried a lot of different things, but the best outcome I got was arrayed image.
Could someone please paste me a code snippet or point me in the right direction.
Best regards,
Jake
Resize 2D image/texture
-
hybrid
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Resize 2D image/texture
Depends on whether you want the image to become larger, or render it larger. The former is achieved with copyToScaling from IImage, the latter with draw2dimage using a destRect which is larger or smaller than the sourceRect.
Re: Resize 2D image/texture
I wanted to render it larger. I managed to get it working. Thanks
.
Here is the code snippet if anyone will have the same problem:
And a function prototype:
Regards,
Jake
Here is the code snippet if anyone will have the same problem:
Code: Select all
driver->draw2DImage( image, rect<s32>(50, 50, 150, 150), rect<s32>( 0, 0, 500, 500), 0, 0, false);
Code: Select all
virtual void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect =0,
const video::SColor * const colors=0, bool useAlphaChannelOfTexture=false) =0;Jake