What is the function of Graphics.ScaleX and Graphics.ScaleY?

Can anyone tell me what is the purpose of those two properties ? I have read the definition in the documentation , but still dont understand.

Thank You.

You should be able to scale your drawing to a different size.
e.g. scale to 200%

1 Like

Thank you Sir , I understood .

Here is the scaling…!

Screenshot (140)|690x495

Here is the code
g.PenHeight = 5 'The height of the pen when drawing lines , oval , rectangles
g.PenWidth = 5
g.ScaleX = 5
g.ScaleY = 5
g.DrawRect(10,10,100,100) 'This draws a rectangle with 5 pixed border

I am not sure what platforms actually support scale and whether graphics class has bugs in this regard.

I just tried this in a new project on macOS in Xojo 2020r2.
Drawing looks correct.

1 Like

Yes , I’m just a beginner , apparently i used Graphics class for the Canvas and yes it worked perfectly. I dont know what other uses are there for the Graphics Class.

Maybe will find out more as i progress with my learning journey

So that sets the scale part of the translation matrix.
Would be great if Xojo could add more translations. Can save a lot of calculations. Meanwhile, CGContextMBS has them.

2 Likes

Welcome to the Xojo world!
If you need more than Xojo has built-in, you can always check MBS Xojo Plugins.
Maybe watch some videos here.

1 Like