Help Center

CGpGraphics.GetClipmethod

Gets the clipping region of this **Graphics** object.

GraphicsmethodCGpGraphics.incdocumented

Syntax

FUNCTION GetClip (BYVAL pRegion AS CGpRegion PTR) AS GpStatus

Parameters

NameDescription
pRegionPointer to a Region object that receives the clipping region.

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

Gets the clipping region of this Graphics object.

Example

' ======================================================================================== ' The following example sets a clipping region. Next, the code gets the clipping region, ' stores it in a Region object, and then uses the stored object to fill the region. ' ======================================================================================== SUB Example_GetClip (BYVAL hdc AS HDC)

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

' // Set a clipping region. graphics.SetClip(0, 0, 200, 100)

' // Get the clipping region. DIM clipRegion AS CGpRegion graphics.GetClip(@clipRegion)

' // Fill the clipping region of the graphics object. graphics.FillRegion(@CGpSolidBrush(ARGB_BLUE), @clipRegion)

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

Reference

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