GdipIsOutlineVisiblePathPointIfunction
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 GdipIsOutlineVisiblePathPointI (BYVAL path AS GpPath PTR, BYVAL x AS INT_, BYVAL y AS INT_, BYVAL pen AS GpPen PTR, BYVAL graphics AS GpGraphics PTR, BYVAL result AS BOOL PTR) AS GpStatus
GdipIsOutlineVisiblePathPoint — one description covers them all.Parameters
| Name | Description | |
|---|---|---|
path | [in] Pointer to the GraphicsPath object. | |
x | [in] The x-coordinate of the point to be tested. | |
y | [in] The y-coordinate of the point to be tested. | |
pen | [in] 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. | |
graphics | [in] 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. | |
result | [out] Pointer to a variable that receives a boolean value indicating whether test point touches the outline of this path (TRUE) or not (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)
DIM hStatus AS LONG
' // Create a graphics object from the device context DIM graphics AS GpGraphics PTR hStatus = GdipCreateFromHDC(hdc, @graphics)
' // Get the DPI scaling ratios DIM dpiX AS SINGLE hStatus = GdipGetDpiX(graphics, @dpiX) DIM rxRatio AS SINGLE = dpiX / 96 DIM dpiY AS SINGLE hStatus = GdipGetDpiY(graphics, @dpiY) Dim ryRatio AS SINGLE = dpiY / 96 ' // Set the scale transform hStatus = GdipScaleWorldTransform(graphics, rxRatio, ryRatio, MatrixOrderPrepend)
' // Create the pen and brush DIM yellowPen AS GpPen PTR hStatus = GdipCreatePen1(ARGB_YELLOW, 20, UnitWorld, @yellowPen) DIM brush AS GpBrush PTR hStatus = GdipCreateSolidFill(ARGB_RED, @brush)
' // Create GraphicsPath DIM path AS GpPath PTR hStatus = GdipCreatePath(FillModeAlternate, @path) ' // Add an ellipse hStatus = GdipAddPathEllipse(path, 50, 50, 200, 100) ' // Draw the path hStatus = GdipDrawPath(graphics, 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 in green. ' // If a point does not touch the outline, paint it red. DIM pts(2) AS GpPointF pts(0).x = 230 : pts(0).y = 138 pts(1).x = 100 : pts(1).y = 120 pts(2).x = 150 : pts(2).y = 170
FOR i AS LONG = 0 TO 2
DIM result AS BOOL
hStatus = GdipIsOutlineVisiblePathPoint(path, pts(i).x, pts(i).y, yellowPen, NULL, @result)
IF result THEN
hStatus = GdipSetSolidFillColor(brush, ARGB_LIGHTGREEN)
ELSE
hStatus = GdipSetSolidFillColor(brush, ARGB_RED)
END IF
hStatus = GdipFillEllipse(graphics, brush, pts(i).x - 3, pts(i).y - 3, 6, 6)
NEXT
' // Cleanup IF yellowPen THEN GdipDeleteBrush(yellowPen) IF brush THEN GdipDeleteBrush(brush) IF path THEN GdipDeletePath(path) IF graphics THEN GdipDeleteGraphics(graphics)
END SUB ' ========================================================================================
Reference
- Defined in AfxNova/AfxGdiPlus.bi:2062
- Documented in Graphics/GdiPlus Flat Api/GdiPlusGraphicsPath.md
- Topic: GraphicsPath Functions