CGpGraphics.FillRegionmethod
Uses a brush to fill a specified region.
Syntax
FUNCTION FillRegion (BYVAL pBrush AS CGpBrush PTR, BYVAL pRegion AS CGpRegion PTR) AS GpStatus
Parameters
| Name | Description | |
|---|---|---|
pBrush | Pointer to a brush that is used to paint the region. | |
pRegion | Pointer to a region to be filled. |
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
Uses a brush to fill a specified region.
Remarks
Because a region describes a set of pixels, a pixel is considered either fully inside, or fully outside the region. Consequently, FillRegion does not antialias the edges of the region.
Example
' ======================================================================================== ' The following example creates a region from a rectangle and then fills the region. ' ======================================================================================== SUB Example_FillRegion (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 SolidBrush object DIM blackBrush AS CGpSolidBrush = ARGB_BLACK
' // Create a Region object from a rectangle. DIM ellipseRegion AS CGpRegion = CGpRegion(0, 0, 200, 100)
' // Fill the region. graphics.FillRegion(@blackBrush, @ellipseRegion)
END SUB ' ========================================================================================
Reference
- Include file
CGpGraphics.inc - Defined in AfxNova/CGpGraphics.inc:841
- Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
- Topic: CGpGraphics Class