Help Center

CGpGraphicsPath.Outlinemethod

Transforms and flattens this path, and then converts this path's data points so that they represent only the outline of the path.

GraphicsmethodCGpPath.incdocumented

Syntax

FUNCTION Outline (pMatrix AS CGpMatrix PTR = NULL, BYVAL flatness AS SINGLE = FlatnessDefault) AS GpStatus

Parameters

NameDescription
pMatrixOptional. Pointer to a Matrix object that specifies the transformation. If this parameter is NULL, no transformation is applied. The default value is NULL.
flatnessOptional. Single precision number that specifies the maximum error between the path and its flattened approximation. Reducing the flatness increases the number of line segments in the approximation. The default value is FlatnessDefault, which is a constant defined in Gdiplusenums.bi.

Return value

If the test point touches the outline of this path, this method returns TRUE; otherwise, it returns FALSE.

Description

Transforms and flattens this path, and then converts this path's data points so that they represent only the outline of the path.

Example

' ======================================================================================== ' The following example creates a GraphicsPath object and calls the GraphicsPath.AddClosedCurve ' method to add a closed cardinal spline to the path. The code calls the GraphicsPath.Widen ' method to widen the path and then draws the path. Next, the code calls the path's Outline ' method. The code calls the TranslateTransform method of a Graphics object so that the ' outlined path drawn by the subsequent call to DrawPath sits to the right of the first path. ' ======================================================================================== SUB Example_Outline (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 bluePen AS CGpPen = ARGB_BLUE DIM greenPen AS CGpPen = CGpPen(ARGB_GREEN, 10)

DIM points(0 TO 3) AS GpPoint = {(20, 20), (160, 100), (140, 60), (60, 100)}

DIM path AS CGpGraphicsPath path.AddClosedCurve(@points(0), 4)

path.Widen(@greenPen) graphics.DrawPath(@bluePen, @path)

path.Outline

graphics.TranslateTransform(180, 0) graphics.DrawPath(@bluePen, @path)

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

Reference

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