Image fitting in roscreen with passing 4 parameter

Hi,
As i have seen in your Roku forum for solution image fitting in roscreen:
viewtopic.php?p=352338

You have provided " DrawScaledObject " solution.
DrawScaledObject(x as Integer, y as Integer, scaleX as Float, scaleY as Float, src as Object) as Boolean

but i am unable to use it. i am creating it in following way under for loop.

             bm=createobject("roBitmap", my images come here) 
			m.screen.DrawScaledObject(FIX(marginX), FIX(marginY), imageWidth, imageHeight, bm)

please provide me some example of using DrawScaledObject, where i can pass 4 parameter: x,y,image’s width, images’s height. and show it on roscreen, just like we pass in roimagecanvas under TargetRect.
I would be thankful for any help

“cpjamloki” wrote:
m.screen.DrawScaledObject(FIX(marginX), FIX(marginY), imageWidth, imageHeight, bm)

imagewidth and imageheight need to be floats - 1.0 is no scaling, .5 would be 50%, 2.1 would be 210% etc.

so:

m.screen.DrawScaledObject(FIX(marginX), FIX(marginY), .5, .5, bm)

As squirreltown noted, the third and forth parameters are the scaling factor, not the final width and height. Try this:

m.screen.DrawScaledObject(FIX(marginX), FIX(marginY), imageWidth / bm.GetWidth(), imageHeight / bm.GetHeight(), bm)

Thanx squirreltown and TheEndless for quick reply. It’s working great .