CGpGraphics.SetRenderingOriginmethod
Sets the rendering origin of this **Graphics** object.
Syntax
FUNCTION SetRenderingOrigin (BYVAL x AS INT_, BYVAL y AS INT_) AS GpStatus
Parameters
| Name | Description | |
|---|---|---|
x | Integer that specifies the x-coordinate of the rendering origin. | |
y | Integer that specifies the y-coordinate of the rendering origin. |
Return value
If the function succeeds, it returns StatusOk, 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 rendering origin of this Graphics object. The rendering origin is used to set the dither origin for 8-bits-per-pixel and 16-bits-per-pixel dithering and is also used to set the origin for hatch brushes.
Example
' ======================================================================================== ' The following example sets the text-rendering hint to low quality and draws text. It then ' gets the text-rendering hint, changes it to high quality, and draws more text to ' demonstrate the difference. ' ======================================================================================== SUB Example_SetRenderingOrigin (BYVAL hdc AS HDC)
' // Create a graphics object from the window device context DIM graphics AS CGpGraphics = hdc ' // Set the scale transform graphics.ScaleTransformForDpi
DIM hatchBrush AS CGpHatchBrush = CGpHatchBrush(HatchStyleDiagonalCross, ARGB_RED, ARGB_AQUA) graphics.FillRectangle(@hatchBrush, 0, 0, 100, 50) graphics.SetRenderingOrigin(3, 0) graphics.FillRectangle(@hatchBrush, 0, 50, 100, 50)
END SUB ' ========================================================================================
Reference
- Include file
CGpGraphics.inc - Defined in AfxNova/CGpGraphics.inc:127
- Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
- Topic: CGpGraphics Class