CGpGraphicsPath.IsVisiblemethod
Determines whether a specified point lies in the area that is filled when this path is filled by a specified **Graphics** object.
Syntax
FUNCTION IsVisible (BYVAL x AS SINGLE, BYVAL y AS SINGLE, BYVAL pGraphics AS CGpGraphics PTR = NULL) AS BOOLEAN
FUNCTION IsVisible (BYVAL x AS INT_, BYVAL y AS INT_, BYVAL pGraphics AS CGpGraphics PTR = NULL) AS BOOLEAN
FUNCTION IsVisible (BYVAL rc AS GpRectF PTR, BYVAL pGraphics AS CGpGraphics PTR = NULL) AS BOOLEAN
FUNCTION IsVisible (BYVAL rc AS GpRect PTR, BYVAL pGraphics AS CGpGraphics PTR = NULL) AS BOOLEAN
Parameters
| Name | Description | |
|---|---|---|
x | The x-coordinate of the point to be tested. | |
y | The y-coordinate of the point to be tested. | |
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 lies in the area that is filled when this path is filled by a specified Graphics object.
Example
' ======================================================================================== ' The following example creates an elliptical path and draws that path with a narrow black ' pen. Then the code tests each point in an array to see whether the point lies in the ' interior of the path. Points that lie in the interior are painted green, and points that ' do not lie in the interior are painted red. ' ======================================================================================== SUB Example_IsVisible (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 blackPen AS CGpPen = CGpPen(ARGB_BLACK, 1) DIM brush AS CGpSolidBrush = ARGB_RED
' // Create and draw a path DIM path AS CGpGraphicsPath path.AddEllipse(50, 50, 200, 100) graphics.DrawPath(@blackPen, @path)
' // Create an array of four 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 3) AS GpPoint = {(50, 100), (250, 100), (150, 170), (180, 60)} FOR j AS LONG = 0 TO 3
IF path.IsVisible(points(j).x, points(j).y, @graphics) 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:571
- Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
- Topic: CGpGraphics Class