GraphicsPath 函数

Windows GDI+公开一个平面 API,其中包含大约 600 个函数,这些函数在 Gdiplus.dll 中实现,并在 Gdiplusflat.h 中声明。 GDI+平面 API 中的函数由大约 40 个 C++ 类的集合包装。 建议不要直接调用平面 API 中的函数。 每当调用GDI+时,都应该通过调用 C++ 包装器提供的方法和函数来执行此操作。 Microsoft 产品支持服务不会为直接调用平面 API 的代码提供支持。 有关使用这些包装器方法的详细信息,请参阅GDI+平面 API

以下平面 API 函数由 GraphicsPath C++ 类包装。

GraphicsPath 函数和相应的包装器方法

平面函数 包装器方法 注解
GpStatus WINGDIPAPI GdipCreatePath (GpFillMode brushMode, GpPath **path)
GraphicsPath::GraphicsPath (IN FillMode fillMode = FillModeAlternate) 创建 GraphicsPath 对象并初始化填充模式。 这是默认构造函数。
GpStatus WINGDIPAPI GdipCreatePath2 (GDIPCONST GpPointF* points, GDIPCONST BYTE* types, INT count, GpFillMode fillMode, GpPath **path)
GraphicsPath::GraphicsPath (IN const PointF* points, IN const BYTE* types, IN INT count, IN FillMode fillMode = FillModeAlternate) 基于点数组、类型数组和填充模式创建 GraphicsPath 对象。
GpStatus WINGDIPAPI GdipCreatePath2I (GDIPCONST GpPoint* points, GDIPCONST BYTE* types, INT count, GpFillMode fillMode, GpPath **path)
GraphicsPath::GraphicsPath (IN const Point* points, IN const BYTE* types, IN INT count, IN FillMode fillMode = FillModeAlternate) 基于点数组、类型数组和填充模式创建 GraphicsPath 对象。
GpStatus WINGDIPAPI GdipClonePath (GpPath* 路径,GpPath **clonePath)
GraphicsPath::GraphicsPath* Clone () const 创建新的 GraphicsPath 对象,并使用此 GraphicsPath 对象的内容初始化它。
GpStatus WINGDIPAPI GdipDeletePath (GpPath* 路径)
GraphicsPath::~GraphicsPath ()
释放 GraphicsPath 对象使用的资源。
GpStatus WINGDIPAPI GdipResetPath (GpPath* 路径)
GraphicsPath::Reset 清空路径并将填充模式设置为 FillModeAlternate。
GpStatus WINGDIPAPI GdipGetPointCount (GpPath* 路径,INT* 计数)
INT GraphicsPath::GetPointCount 获取此路径的数据点数组中的点数。 这与路径的点类型的数组中的类型数相同。
GpStatus WINGDIPAPI GdipGetPathTypes (GpPath* 路径、BYTE* 类型、INT count)
Status GraphicsPath::GetPathTypes (OUT BYTE* 类型,INT count) const 获取此路径的点类型的数组。
GpStatus WINGDIPAPI GdipGetPathPoints (GpPath*、 GpPointF* 点、INT 计数)
Status GraphicsPath::GetPathPoints (OUT PointF* points, INT count) const 获取此路径的点数组。 数组包含用于绘制路径的线条和 Bézier 样条的终结点和控制点。
GpStatus WINGDIPAPI GdipGetPathPointsI (GpPath*, GpPoint* points, INT count)
Status GraphicsPath::GetPathPoints (OUT Point* points, INT count) const 获取此路径的点数组。 数组包含用于绘制路径的线条和 Bézier 样条的终结点和控制点。
GpStatus WINGDIPAPI GdipGetPathFillMode (GpPath *path, GpFillMode *fillmode)
FillMode GraphicsPath::GetFillMode () const 获取此路径的填充模式。
GpStatus WINGDIPAPI GdipSetPathFillMode (GpPath *path, GpFillMode fillmode)
Status GraphicsPath::SetFillMode (IN FillMode fillmode) 设置此路径的填充模式。
GpStatus WINGDIPAPI GdipGetPathData (GpPath *path, GpPathData* pathData)
Status GraphicsPath::GetPathData (OUT PathData* pathData) const 从此路径获取点类型的数组和点类型的数组。 这两个数组一起定义此路径的线条、曲线、数字和标记。
GpStatus WINGDIPAPI GdipStartPathFigure (GpPath *path)
Status GraphicsPath::StartFigure () 不闭合当前图形即开始一个新图形。 添加到此路径的后续点将添加到新图中。
GpStatus WINGDIPAPI GdipClosePathFigure (GpPath *path)
状态 GraphicsPath::CloseFigure () 关闭此路径的当前图。
GpStatus WINGDIPAPI GdipClosePathFigures (GpPath *path)
Status GraphicsPath::CloseAllFigures () 关闭此路径中的所有打开的数字。
GpStatus WINGDIPAPI GdipSetPathMarker (GpPath* 路径)
Status GraphicsPath::SetMarker () 将此路径中的最后一个点指定为标记点。
GpStatus WINGDIPAPI GdipClearPathMarkers (GpPath* 路径)
状态 GraphicsPath::ClearMarkers () 清除此路径中的标记。
GpStatus WINGDIPAPI GdipReversePath (GpPath* 路径)
Status GraphicsPath::Reverse () 反转定义此路径的线条和曲线的点的顺序。
GpStatus WINGDIPAPI GdipGetPathLastPoint (GpPath* path, GpPointF* lastPoint)
Status GraphicsPath::GetLastPoint (OUT PointF* lastPoint) const 获取此路径中最后一个图的结束点。
GpStatus WINGDIPAPI GdipAddPathLine (GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2)
Status GraphicsPath::AddLine (IN REAL x1、IN REAL y1、IN REAL x2、IN REAL y2) 向此路径的当前图添加一行。
GpStatus WINGDIPAPI GdipAddPathLine2 (GpPath *path, GDIPCONST GpPointF *points, INT count)
Status GraphicsPath::AddLines (IN const PointF* points, IN INT count) 将连接线序列添加到此路径的当前图中。
GpStatus WINGDIPAPI GdipAddPathArc (GpPath *path, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
Status GraphicsPath::AddArc (IN REAL x, IN REAL y, IN REAL width, IN REAL height, IN REAL startAngle, IN REAL sweepAngle) 将椭圆弧添加到此路径的当前图中。
GpStatus WINGDIPAPI GdipAddPathBezier (GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2, REAL x3, REAL y3, REAL x4, REAL y4)
Status GraphicsPath::AddBezier (IN REAL x1、IN REAL y1、IN REAL x2、IN REAL y2、IN REAL x3、IN REAL y3、IN REAL x4、IN REAL x4、IN REAL y4) 将 Bézier 样条添加到此路径的当前图中。
GpStatus WINGDIPAPI GdipAddPathBeziers (GpPath *path, GDIPCONST GpPointF *points, INT count)
Status GraphicsPath::AddBeziers (IN const PointF* points, IN INT count) 将连接的 Bézier 样条序列添加到此路径的当前图中。
GpStatus WINGDIPAPI GdipAddPathCurve (GpPath *path, GDIPCONST GpPointF *points, INT count)
Status GraphicsPath::AddCurve (IN const PointF* points, IN INT count) 将基数样条添加到此路径的当前图中。
GpStatus WINGDIPAPI GdipAddPathCurve2 (GpPath *path, GDIPCONST GpPointF *points, INT count, REAL tension)
Status GraphicsPath::AddCurve (IN const PointF* points, IN INT count, IN REAL tension) 将基数样条添加到此路径的当前图。
GpStatus WINGDIPAPI GdipAddPathCurve3 (GpPath *path, GDIPCONST GpPointF *points, INT count, INT offset, INT numberOfSegments, REAL 紧张)
状态 GraphicsPath::AddCurve (IN const PointF* 磅、INT 计数、IN INT 偏移量、INT numberOfSegments、IN REAL 紧张) 将基数样条添加到此路径的当前图。
GpStatus WINGDIPAPI GdipAddPathClosedCurve (GpPath *path, GDIPCONST GpPointF *points, INT count)
Status GraphicsPath::AddClosedCurve (IN const PointF* points, INT count) 向此路径添加一个闭合基样线。
GpStatus WINGDIPAPI GdipAddPathClosedCurve2 (GpPath *path, GDIPCONST GpPointF *points, INT count, REAL tension)
Status GraphicsPath::AddClosedCurve (IN const PointF* points, IN INT count, IN REAL 紧张) 向此路径添加一个闭合基样线。
GpStatus WINGDIPAPI GdipAddPathRectangle (GpPath *path, REAL x, REAL y, REAL width, REAL height)
Status GraphicsPath::AddRectangle (IN const RectF rectf& rect) 向此路径添加一个矩形。
平面函数中的 xy宽度高度 参数指定一个矩形,该矩形对应于包装方法中的 rect 参数。
GpStatus WINGDIPAPI GdipAddPathRectangles (GpPath *path, GDIPCONST GpRectF *rects, INT count)
Status GraphicsPath::AddRectangles (IN const RectF* rects, IN INT count) 将一系列矩形添加到此路径。
GpStatus WINGDIPAPI GdipAddPathEllipse (GpPath *path, REAL x, REAL y, REAL width, REAL height)
Status GraphicsPath::AddEllipse (IN REAL x, IN REAL y, IN REAL width, IN REAL height) 将省略号添加到此路径。
GpStatus WINGDIPAPI GdipAddPathPie (GpPath *path, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
Status GraphicsPath::AddPie (IN REAL x、IN REAL y、IN REAL width、IN REAL height、IN REAL startAngle、IN REAL sweepAngle) 将饼图添加到此路径。 弧线是椭圆的一部分,饼图是椭圆括起来的区域的一部分。 饼图由弧线和两行 (边) ,从椭圆中心到弧线的端点。
GpStatus WINGDIPAPI GdipAddPathPolygon (GpPath *path, GDIPCONST GpPointF *points, INT count)
Status GraphicsPath::AddPolygon (IN const PointF* points, INT count) 向此路径添加多边形。
GpStatus WINGDIPAPI GdipAddPathPath (GpPath *path, GDIPCONST GpPath* addingPath, BOOL connect)
Status GraphicsPath::AddPath (IN const GraphicsPath* addPath, IN BOOL connect) 将路径添加到此路径。
GpStatus WINGDIPAPI GdipAddPathString (GpPath *path, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFontFamily *family, INT style, REAL emSize, GDIPCONST RectF *layoutRect, GDIPCONST GpStringFormat *format)
Status GraphicsPath::AddString ( IN const WCHAR *string, IN INT length, IN const FontFamily *family, IN INT style, IN REAL emSize, IN const RectF &layoutRect, IN const StringFormat *format ) 将字符串的轮廓添加到此路径。
GpStatus WINGDIPAPI GdipAddPathStringI (GpPath *path, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFontFamily *family, INT style, REAL emSize, GDIPCONST Rect *layoutRect, GDIPCONST GpStringFormat *format)
Status GraphicsPath::AddString ( IN const WCHAR *string, IN INT length, IN const FontFamily *family, IN INT style, IN REAL emSize, IN const Rect &layoutRect, IN const StringFormat *format ) 将字符串的轮廓添加到此路径。
GpStatus WINGDIPAPI GdipAddPathLineI (GpPath *path, INT x1, INT y1, INT x2, INT y2)
状态 GraphicsPath::AddLine (INT x1、INT y1、INT x2、INT y2) 向此路径的当前图添加一行。
GpStatus WINGDIPAPI GdipAddPathLine2I (GpPath *path, GDIPCONST GpPoint *points, INT count)
Status GraphicsPath::AddLines (IN const Point* points, IN INT count) 将连接线序列添加到此路径的当前图中。
GpStatus WINGDIPAPI GdipAddPathArcI (GpPath *path, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle)
Status GraphicsPath::AddArc (INT x, INT y, INT 宽度, INT 高度, IN REAL startAngle, IN REAL sweepAngle) 将椭圆弧添加到此路径的当前图中。
GpStatus WINGDIPAPI GdipAddPathBezierI (GpPath *path, INT x1, INT y1, INT x2, INT y2, INT x3, INT y3, INT x4, INT y4)
Status GraphicsPath::AddBezier (INT x1、INT y1、INT x2、INT y2、INT x3、INT y3、INT y3、INT x4、INT y4) 将 Bézier 样条添加到此路径的当前图中。
GpStatus WINGDIPAPI GdipAddPathBeziersI (GpPath *path, GDIPCONST GpPoint *points, INT count)
Status GraphicsPath::AddBeziers (IN const Point* points, INT count) 将 Bézier 样条添加到此路径的当前图中。
GpStatus WINGDIPAPI GdipAddPathCurveI (GpPath *path, GDIPCONST GpPoint *points, INT count)
Status GraphicsPath::AddCurve (IN const Point* points, IN INT count) 将基数样条添加到此路径的当前图。
GpStatus WINGDIPAPI GdipAddPathCurve2I (GpPath *path, GDIPCONST GpPoint *points, INT count, REAL tension)
Status GraphicsPath::AddCurve (IN const Point* points, INT count, IN REAL tension) 将基数样条添加到此路径的当前图。
GpStatus WINGDIPAPI GdipAddPathCurve3I (GpPath *path, GDIPCONST GpPoint *points, INT count, INT offset, INT numberOfSegments, REAL 紧张)
Status GraphicsPath::AddCurve (IN const Point* points, IN INT count, IN INT offset, INT numberOfSegments, IN REAL 紧张) 将基数样条添加到此路径的当前图。
GpStatus WINGDIPAPI GdipAddPathClosedCurveI (GpPath *path, GDIPCONST GpPoint *points, INT count)
Status GraphicsPath::AddClosedCurve (IN const Point* points, IN INT count) 向此路径添加一个闭合基样线。
GpStatus WINGDIPAPI GdipAddPathClosedCurve2I (GpPath *path, GDIPCONST GpPoint *points, INT count, REAL tension)
状态 GraphicsPath::AddClosedCurve (IN const Point* 点,INT 计数,IN REAL 紧张) 向此路径添加一个闭合基样线。
GpStatus WINGDIPAPI GdipAddPathRectangleI (GpPath *path, INT x, INT y, INT width, INT height)
Status GraphicsPath::AddRectangle (IN const Rect rect&) 向此路径添加一个矩形。
平面函数中的 xy宽度高度 参数指定一个矩形,该矩形对应于包装方法中的 rect 参数。
GpStatus WINGDIPAPI GdipAddPathRectanglesI (GpPath *path, GDIPCONST GpRect *rects, INT count)
Status GraphicsPath::AddRectangles (IN const Rect* rects, INT count) 向此路径添加一系列矩形
GpStatus WINGDIPAPI GdipAddPathEllipseI (GpPath *path, INT x, INT y, INT width, INT height)
Status GraphicsPath::AddEllipse (INT x, INT y, INT width, INT height) 将省略号添加到此路径。
GpStatus WINGDIPAPI GdipAddPathPieI (GpPath *path, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle)
Status GraphicsPath::AddPie (INT x, INT y, INT width, INT height, IN REAL startAngle, IN REAL sweepAngle) 将饼图添加到此路径。 弧线是椭圆的一部分,饼图是椭圆括起来的区域的一部分。 饼图由弧线和两行 (边) ,从椭圆中心到弧线的端点。
GpStatus WINGDIPAPI GdipAddPathPolygonI (GpPath *path, GDIPCONST GpPoint *points, INT count)
Status GraphicsPath::AddPolygon (IN const Point* points, INT count) 向此路径添加多边形。
GpStatus WINGDIPAPI GdipFlattenPath (GpPath *path, GpMatrix* matrix, REAL flatness)
Status GraphicsPath::Flatten (IN const Matrix* matrix = NULL,IN REAL flatness = FlatnessDefault) 将转换应用于此路径,并将路径中的每个曲线转换为连接线序列。
GpStatus WINGDIPAPI GdipWindingModeOutline ( GpPath *path, GpMatrix *matrix, REAL flatness )
Status GraphicsPath::Outline ( IN const Matrix *matrix = NULL,IN REAL flatness = FlatnessDefault ) 转换并平展此路径,然后转换此路径的数据点,以便它们仅表示路径的轮廓。
GpStatus WINGDIPAPI GdipWidenPath ( GpPath *nativePath, GpPen *pen, GpMatrix *matrix, REAL flatness )
Status GraphicsPath::Wide ( IN const Pen* pen, IN const Matrix* matrix = NULL, IN REAL flatness = FlatnessDefault ) 将此路径替换为用指定的笔绘制此路径时填充的区域的曲线。 此方法还会平展路径。
GpStatus WINGDIPAPI GdipWarpPath (GpPath *path, GpMatrix* matrix, GDIPCONST GpPointF *points, INT count, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, WarpMode warpMode, REAL flatness)
Status GraphicsPath::Warp (IN const PointF* destPoints, IN INT count, IN const RectF& srcRect, IN const Matrix* matrix = NULL, IN WarpMode warpMode = WarpModePerspective, IN REAL flatness = FlatnessDefault) 将扭曲转换应用于此路径。 此方法还会平展 (转换为路径) 直线序列。
平面函数中的 srcxsrcysrcwidthsrcheight 参数指定一个矩形,该矩形对应于包装方法中的 srcRect 参数。
GpStatus WINGDIPAPI GdipTransformPath (GpPath* path, GpMatrix* matrix)
Status GraphicsPath::Transform (IN const Matrix* matrix) 将此路径的每个数据点乘以指定的矩阵。
GpStatus WINGDIPAPI GdipGetPathWorldBounds (GpPath* path, GpRectF* bounds, GDIPCONST GpMatrix *matrix, GDIPCONST GpPen *pen)
状态 GraphicsPath::GetBounds (OUT RectF* 边界、IN const Matrix* 矩阵、IN const Pen* 笔) const 获取此路径的边界矩形。
GpStatus WINGDIPAPI GdipGetPathWorldBoundsI (GpPath* path, GpRect* bounds, GDIPCONST GpMatrix *matrix, GDIPCONST GpPen *pen)
Status GraphicsPath::GetBounds (OUT Rect* bounds, IN const Matrix* matrix, IN const Pen* pen) const 获取此路径的边界矩形。
GpStatus WINGDIPAPI GdipIsVisiblePathPoint (GpPath* 路径,REAL x, REAL y, GpGraphics *graphics, BOOL *result)
BOOL GraphicsPath::IsVisible (IN REAL x、IN REAL y、IN const Graphics* g) const 确定指定点是否位于指定 图形 对象填充此路径时填充的区域。
GpStatus WINGDIPAPI GdipIsVisiblePathPointI (GpPath* 路径,INT x, INT y, GpGraphics *graphics, BOOL *result)
BOOL GraphicsPath::IsVisible (INT x、INT y、IN const Graphics* g) const 确定指定点是否位于指定 图形 对象填充此路径时填充的区域。
GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPoint (GpPath* path, REAL x, REAL y, GpPen *pen, GpGraphics *graphics, BOOL *result)
BOOL GraphicsPath::IsOutlineVisible (IN REAL x、IN REAL y、IN const Pen* pen、IN const Graphics* g) const 确定指定点是否在由指定的 图形 对象和指定的笔绘制路径时触摸此路径的轮廓。
GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPointI (GpPath* path, INT x, INT y, GpPen *pen, GpGraphics *graphics, BOOL *result)
BOOL GraphicsPath::IsOutlineVisible (INT x、INT y、IN const Pen* 笔、IN const Graphics* g) const 确定指定点是否在由指定的 图形 对象和指定的笔绘制路径时触摸此路径的轮廓。