CGpHatchBrush.GetBackgroundColormethod
Gets the background color of this hatch brush.
Syntax
FUNCTION GetBackgroundColor (BYVAL colour AS ARGB PTR) AS GpStatus
FUNCTION GetBackgroundColor () AS ARGB
Parameters
| Name | Description | |
|---|---|---|
colour | Pointer to a variable that receives the background color. The background color defines the color over which the hatch lines are drawn. |
Return value
If the function succeeds, it returns Ok, which is an element of the GpStatus enumeration.
If the function fails, it returns one of the other elements of the GpStatus enumeration.
The second overloaded function returns the ARGB color as the result of the function.
Description
Gets the background color of this hatch brush.
Example
' ======================================================================================== ' The following example sets up three Color objects: black, turquoise, and current ' (initialized to black). A rectangle is painted by using turquoise as the background ' color and black as the foreground color. Then the HatchBrush.GetBackgroundColor method ' is used to get the current color of the brush (which at the time is turquoise). The ' address of the current Color object (initialized to black) is passed as the return point ' for the call to HatchBrush,GetBackgroundColor. When the rectangle is painted again, ' note that the background color is again turquoise (not black). This shows that the call ' to HatchBrush.GetBackgroundColor was successful. ' ======================================================================================== SUB Example_HatchBrushGetBackgroundColor (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 and then draw the first hatch style. DIM brush AS CGpHatchBrush = CGpHatchBrush(HatchStyleHorizontal, ARGB_BLACK, ARGB_Turquoise) graphics.FillRectangle(@brush, 20, 20, 100, 50)
' // Get the current background color of the brush. DIM current AS ARGB = brush.GetBackgroundColor
' // Draw the rectangle again using the current color. DIM brush2 AS CGpHatchBrush = CGpHatchBrush(HatchStyleDiagonalCross, ARGB_BLACK, current) graphics.FillRectangle(@brush2, 130, 20, 100, 50)
END SUB ' ========================================================================================
Reference
- Include file
CGpBrush.inc - Defined in AfxNova/CGpBrush.inc:954
- Documented in Graphics/GdiPlus Classes/CGpBrush Classes.md
- Topic: CGpBrush Class