Help Center

CGpPen.ScaleTransformmethod

Sets the **Pen** object's world transformation matrix equal to the product of itself and a scaling matrix.

GraphicsmethodCGpPen.incdocumented

Syntax

FUNCTION ScaleTransform (BYVAL sx AS SINGLE, BYVAL sy AS SINGLE, BYVAL order AS MatrixOrder = MatrixOrderPrepend) AS GpStatus

Parameters

NameDescription
sxThe amount to scale in the x direction.
syThe amount to scale in the y direction.
orderOptional. Element of the MatrixOrder enumeration that specifies the order of multiplication. MatrixOrderPrepend specifies that the passed matrix is on the left, and MatrixOrderAppend specifies that the passed matrix is on the right. The default value is MatrixOrderPrepend.

Return value

If the function succeeds, it returns Ok, which is an element of the GpStatus enumeration.

If the function fails, it returns one of the other elements of the GpStatus enumeration.

Description

Sets the Pen object's world transformation matrix equal to the product of itself and a scaling matrix.

Example

' ======================================================================================== ' The following example creates a Pen object and draws a rectangle. The code then applies ' a scaling transformation to the pen and draws a second rectangle. ' ======================================================================================== SUB Example_ScaleTransform (BYVAL hdc AS HDC)

' // Create a graphics object from the window device context DIM graphics AS CGpGraphics = hdc ' // Set the scale transform graphics.ScaleTransformForDpi

' // Create a pen, and use it to draw a rectangle DIM pen AS CGpPen = CGpPen(ARGB_BLUE, 2) graphics.DrawRectangle(@pen, 50, 50, 150, 100)

' // Apply a scaling transformation to the pen pen.ScaleTransform(8, 4)

' // Draw a rectangle with the transformed pen. graphics.DrawRectangle(@pen, 250, 50, 150, 100)

END SUB ' ========================================================================================

Reference

  • Include file CGpPen.inc
  • Defined in AfxNova/CGpPen.inc:280
  • Documented in Graphics/GdiPlus Classes/CGpPen Class.md
  • Topic: CGpPen Class