From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Graphics.Scale(x As Double, y As Double)

New in 2021r1

Supported for all project types and targets.

Sets the scale for the graphics context as specified scaleX and scaleY. This only affects subsequent drawing. Any drawing done before the Scale method is called is not scaled.


When used in combination with Rotate and/or Translate to draw into a PDFDocument, Scale may behave differently than it does when drawing to normal Graphics object because the scaling is being handled by the PDF engine itself.

Sample Code

From within the MobileCanvas.Paint event handler:

g.Scale(2.0, 4.0)
g.DrawingColor = Color.Blue
g.FillRectangle(10, 10, 10, 10) // The squares scales to a rectangle