Draw resized picture

Somehow I don’t understand how to resize a picture proportionally. This is the code I have in the Paint event of a MobileCanvas. i could be 1 to 5, so I would like to draw the same picture five times at X = 0, 20%, 40%, 60% and 80% of the MobileCanvas’ width.

The picture is being drawn at the correct X coordinate but it’s cropped at 25% of its size. I have no idea how to change the code to scale it proportionally, I thought this would do it:

var p as Picture = picture.SystemImage("", 40, picture.SystemImageWeights.Regular, _
color.White, icon_ball)

g.DrawPicture(p, _
round(((i - 1) * 0.2) * me.Width), 0, _
round(me.Width * .15), me.Height, _
0, 0, _
p.Width, p.Height)

I believe this is the relevant feedback case


1 Like

I was able to solve this in the meantime. Well, it wasn’t me to be honest, it was pure luck who did it.

Replacing the 40 as the picture size in the first line by 1 did the trick.