CGpGraphicsPath.IsOutlineVisiblemethod
Determines whether a specified point touches the outline of this path when the path is drawn by a specified Graphics object and a specified pen.
Syntax
FUNCTION IsOutlineVisible (BYVAL x AS SINGLE, BYVAL y AS SINGLE, BYVAL pPen AS CGpPen PTR, BYVAL pGraphics AS CGpGraphics PTR = NULL) AS BOOLEAN
FUNCTION IsOutlineVisible (BYVAL x AS INT_, BYVAL y AS INT_, BYVAL pPen AS CGpPen PTR, BYVAL pGraphics AS CGpGraphics PTR = NULL) AS BOOLEAN
FUNCTION IsOutlineVisible (BYVAL pt AS GpPointF PTR, BYVAL pPen AS CGpPen PTR, BYVAL pGraphics AS CGpGraphics PTR = NULL) AS BOOLEAN
FUNCTION IsOutlineVisible (BYVAL pt AS GpPoint PTR, BYVAL pPen AS CGpPen PTR, BYVAL pGraphics AS CGpGraphics PTR = NULL) AS BOOLEAN
Parameters
| Name | Description | |
|---|---|---|
x | The x-coordinate of the point to be tested. | |
y | The x-coordinate of the point to be tested. | |
pPen | Pointer to a Pen object. This method determines whether the test point touches the path outline that would be drawn by this pen. More points will touch an outline drawn by a wide pen than will touch an outline drawn by a narrow pen. | |
pGraphics | Optional. Pointer to a Graphics object that specifies a world-to-device transformation. If the value of this parameter is NULL, the test is done in world coordinates; otherwise, the test is done in device coordinates. The default value is NULL. |
Return value
If the test point touches the outline of this path, this method returns TRUE; otherwise, it returns FALSE.
Description
Determines whether a specified point touches the outline of this path when the path is drawn by a specified Graphics object and a specified pen.
Example
' ======================================================================================== ' The following example creates an elliptical path and draws that path with a wide yellow ' pen. Then the code tests each point in an array to see whether the point touches the ' outline (as it would be drawn by the wide yellow pen) of the path. Points that touch the ' outline are painted green, and points that don't touch the outline are painted red. ' ======================================================================================== SUB Example_IsOutlineVisible (BYVAL hdc AS HDC)
' // Create a graphics object from the window device context DIM graphics AS CGpGraphics = hdc ' // Set the scale transform graphics.ScaleTransformForDpi
DIM yellowPen AS CGpPen = CGpPen(ARGB_YELLOW, 20) DIM brush AS CGpSolidBrush = ARGB_RED
' // Create and draw a path DIM path AS CGpGraphicsPath path.AddEllipse(50, 50, 200, 100) graphics.DrawPath(@yellowPen, @path)
' // Create an array of three points, and determine whether each ' // point in the array touches the outline of the path. ' // If a point touches the outline, paint it green. ' // If a point does not touch the outline, paint it red. DIM points(0 TO 2) AS GpPoint = {(230, 138), (100, 120), (150, 170)} FOR j AS LONG = 0 TO 2
IF path.IsOutlineVisible(points(j).x, points(j).y, @yellowPen, NULL) THEN
brush.SetColor(ARGB_GREEN)
ELSE
brush.SetColor(ARGB_RED)
END IF
graphics.FillEllipse(@brush, points(j).x - 3, points(j).y - 3, 6, 6)
NEXT
END SUB ' ========================================================================================
Reference
- Include file
CGpPath.inc - Defined in AfxNova/CGpPath.inc:603
- Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
- Topic: CGpGraphics Class