Hi,
I'm currently using the draw2DImage method from irr 1.4.2 however I would like to change the size of the image displayed instead of repeating it more times to complete the rectangle to fill...
I managed with some randomly values to change the scale Y of an image but it was really randomly, when I added 50px to the rectangle source, the image source size scaled up, but when adding 49 or 51, nothing.
So, is there a way to change images sizes with this method, or with another ?
Thank,
Stef.
[Solved] scale an image drawed by draw2Dimage method
[Solved] scale an image drawed by draw2Dimage method
Last edited by stefbuet on Fri Dec 26, 2008 12:33 pm, edited 1 time in total.
If you're using Visual Studio 2005, you want the 2nd overloaded draw2dImage function (2 / 4), it should read something like this
-Where background is your image
-the first rect is your preferred "size"
-the second rect is the dimensions of your image (the actual dimensions, you can see this in details view of windows explorer or a photo editing program like Photoshop). For instance, if your image was 342 x 831, that rect should read, "rect<s32>(0, 0, 342, 831)".
-you probably don't care about the 4th parameter unless you want do so some clipping,
-the 5th paramater is an SColor, you probably dont want that either since you are using an image
-and the last paramter is whether or not the image should use alpha (careful though, this is not standard alpha like in .tga files. If you want more explanation of this just ask)
Code: Select all
driver->draw2DImage(background, rect<s32>(leftX1, leftY1, bottomX2, bottomY2), rect<s32>(0, 0, bottomWidth, totalHeight), 0, 0, true);-the first rect is your preferred "size"
-the second rect is the dimensions of your image (the actual dimensions, you can see this in details view of windows explorer or a photo editing program like Photoshop). For instance, if your image was 342 x 831, that rect should read, "rect<s32>(0, 0, 342, 831)".
-you probably don't care about the 4th parameter unless you want do so some clipping,
-the 5th paramater is an SColor, you probably dont want that either since you are using an image
-and the last paramter is whether or not the image should use alpha (careful though, this is not standard alpha like in .tga files. If you want more explanation of this just ask)