Help Center

CGpGraphicsPathIterator.IsValidmethod

Checks whether a **GraphicsPathIterator** is valid.

GraphicsmethodCGpGraphics.incdocumented

Syntax

FUNCTION CGpGraphicsPathIterator.IsValid () AS BOOLEAN

Description

Checks whether a GraphicsPathIterator is valid, meaning it’s properly associated with a GraphicsPath and ready for use.

Example

' ======================================================================================== ' Checks whether a GraphicsPathIterator is valid, meaning it’s properly associated with a ' GraphicsPath and ready for use. ' ======================================================================================== SUB Example_PathIterIsValid (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 GraphicsPath with a simple figure DIM path AS CGpGraphicsPath path.AddLine(50, 50, 150, 50) path.AddLine(150, 50, 100, 120) path.CloseFigure

' // Create a GraphicsPathIterator DIM iterator AS CGpGraphicsPathIterator = @path

' // Check if the iterator is valid DIM isValid AS BOOLEAN = iterator.IsValid

' // Create font and brush for displaying the result DIM fontFamily AS CGpFontFamily = CGpFontFamily("Arial") DIM font AS CGpFont = CGpFont(@fontFamily, AfxGdipPointsToPixels(16, TRUE), FontStyleRegular) DIM brush AS CGpSolidBrush = ARGB_BLACK

' // Draw the validity result as a string DIM info AS STRING = "PathIterator is valid: " & IIF(isValid, "True", "False") DIM layout AS GpRectF = (10.0, 10.0, 300.0, 20.0) graphics.DrawString(info, -1, @font, @layout, @brush)

END SUB ' ========================================================================================

Reference

  • Include file CGpGraphics.inc
  • Defined in AfxNova/CGpPath.inc:766
  • Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
  • Topic: CGpGraphics Class