CGpGraphics.IntersectClipmethod
Updates the clipping region of this **Graphics** object to the portion of the specified rectangle that intersects with the current clipping region of this **Graphics** object.
Syntax
FUNCTION IntersectClip (BYVAL rc AS GpRectF PTR) AS GpStatus
FUNCTION IntersectClip (BYVAL rc AS GpRect PTR) AS GpStatus
FUNCTION IntersectClip (BYVAL x AS SINGLE, BYVAL y AS SINGLE, BYVAL nWidth AS SINGLE, BYVAL nHeight AS SINGLE) AS GpStatus
FUNCTION IntersectClip (BYVAL x AS INT_, BYVAL y AS INT_, BYVAL nWidth AS INT_, BYVAL nHeight AS INT_) AS GpStatus
FUNCTION IntersectClip (BYVAL pRegion AS CGpRegion PTR) AS GpStatus
Parameters
| Name | Description | |
|---|---|---|
rc | Reference to a rectangle that is used to update the clipping region. | |
pRegion | Pointer to a region that is used to update the clipping region of this Graphics object. |
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
Updates the clipping region of this Graphics object to the portion of the specified rectangle that intersects with the current clipping region of this Graphics object.
Example
' ======================================================================================== ' The following example sets a clipping region and updates the clipping region. It then ' draws rectangles to demonstrate the effective clipping region. ' ======================================================================================== SUB Example_IntersectClip (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 the clipping region. DIM clipRect AS GpRectF = (0.5, 0.5, 200.5, 200.5) graphics.SetClip(@clipRect)
' // Update the clipping region to the portion of the rectangle that ' // intersects with the current clipping region. DIM rcIntersect AS GpRectF = (100.5, 100.5, 200.5, 200.5) graphics.IntersectClip(@rcIntersect)
' // Fill a rectangle to demonstrate the effective clipping region. graphics.FillRectangle(@CGpSolidBrush(ARGB_BLACK), 0, 0, 500, 500)
' // Reset the clipping region to infinite. graphics.ResetClip
' // Draw clipRect and intersectRect. graphics.DrawRectangle(@CGpPen(ARGB_BLACK), @clipRect) graphics.DrawRectangle(@CGpPen(ARGB_RED), @rcIntersect)
END SUB ' ========================================================================================
Reference
- Include file
CGpGraphics.inc - Defined in AfxNova/CGpGraphics.inc:1319
- Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
- Topic: CGpGraphics Class