CGpGraphics.FillRectanglemethod
Uses a brush to fill the interior of a rectangle.
Syntax
FUNCTION FillRectangle (BYVAL pBrush AS CGpBrush PTR, BYVAL x AS SINGLE, BYVAL y AS SINGLE, BYVAL nWidth AS SINGLE, BYVAL nHeight AS SINGLE) AS GpStatus
FUNCTION FillRectangle (BYVAL pBrush AS CGpBrush PTR, BYVAL x AS INT_, BYVAL y AS INT_, BYVAL nWidth AS INT_, BYVAL nHeight AS INT_) AS GpStatus
FUNCTION FillRectangle (BYVAL pBrush AS CGpBrush PTR, BYVAL rc AS GpRectF PTR) AS GpStatus
FUNCTION FillRectangle (BYVAL pBrush AS CGpBrush PTR, BYVAL rc AS GpRect PTR) AS GpStatus
Parameters
| Name | Description | |
|---|---|---|
pBrush | Pointer to a brush that is used to paint the interior of the rectangle. | |
x | The x-coordinate of the upper-left corner of the rectangle to be filled. | |
y | The y-coordinate of the upper-left corner of the rectangle to be filled. | |
nWidth | The width of the rectangle to be filled. | |
nHeight | The height of the rectangle 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 the interior of a rectangle.
Example
' ======================================================================================== ' The following example uses a brush to fill the interior of a rectangle. ' ======================================================================================== SUB Example_FillRectangle (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
' // Fill the rectangle graphics.FillRectangle(@blackBrush, 0, 0, 100, 100)
END SUB ' ========================================================================================
Reference
- Include file
CGpGraphics.inc - Defined in AfxNova/CGpGraphics.inc:702
- Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
- Topic: CGpGraphics Class