📄 gdipluspath.h
字号:
Status AddCurve(IN const Point* points,
IN INT count,
IN INT offset,
IN INT numberOfSegments,
IN REAL tension)
{
return SetStatus(DllExports::GdipAddPathCurve3I(nativePath,
points,
count,
offset,
numberOfSegments,
tension));
}
// float version
Status AddClosedCurve(IN const PointF* points,
IN INT count)
{
return SetStatus(DllExports::GdipAddPathClosedCurve(nativePath,
points,
count));
}
Status AddClosedCurve(IN const PointF* points,
IN INT count,
IN REAL tension)
{
return SetStatus(DllExports::GdipAddPathClosedCurve2(nativePath,
points,
count,
tension));
}
// integer version
Status AddClosedCurve(IN const Point* points,
IN INT count)
{
return SetStatus(DllExports::GdipAddPathClosedCurveI(nativePath,
points,
count));
}
Status AddClosedCurve(IN const Point* points,
IN INT count,
IN REAL tension)
{
return SetStatus(DllExports::GdipAddPathClosedCurve2I(nativePath,
points,
count,
tension));
}
/**
* Add closed shapes to the path object
*/
// float version
Status AddRectangle(IN const RectF& rect)
{
return SetStatus(DllExports::GdipAddPathRectangle(nativePath,
rect.X,
rect.Y,
rect.Width,
rect.Height));
}
Status AddRectangles(IN const RectF* rects,
IN INT count)
{
return SetStatus(DllExports::GdipAddPathRectangles(nativePath,
rects,
count));
}
// integer version
Status AddRectangle(IN const Rect& rect)
{
return SetStatus(DllExports::GdipAddPathRectangleI(nativePath,
rect.X,
rect.Y,
rect.Width,
rect.Height));
}
Status AddRectangles(IN const Rect* rects, INT count)
{
return SetStatus(DllExports::GdipAddPathRectanglesI(nativePath,
rects,
count));
}
// float version
Status AddEllipse(IN const RectF& rect)
{
return AddEllipse(rect.X, rect.Y, rect.Width, rect.Height);
}
Status AddEllipse(IN REAL x,
IN REAL y,
IN REAL width,
IN REAL height)
{
return SetStatus(DllExports::GdipAddPathEllipse(nativePath,
x,
y,
width,
height));
}
// integer version
Status AddEllipse(IN const Rect& rect)
{
return AddEllipse(rect.X, rect.Y, rect.Width, rect.Height);
}
Status AddEllipse(IN INT x,
IN INT y,
IN INT width,
IN INT height)
{
return SetStatus(DllExports::GdipAddPathEllipseI(nativePath,
x,
y,
width,
height));
}
// float version
Status AddPie(IN const RectF& rect,
IN REAL startAngle,
IN REAL sweepAngle)
{
return AddPie(rect.X, rect.Y, rect.Width, rect.Height, startAngle,
sweepAngle);
}
Status AddPie(IN REAL x,
IN REAL y,
IN REAL width,
IN REAL height,
IN REAL startAngle,
IN REAL sweepAngle)
{
return SetStatus(DllExports::GdipAddPathPie(nativePath, x, y, width, height,
startAngle, sweepAngle));
}
// integer version
Status AddPie(IN const Rect& rect,
IN REAL startAngle,
IN REAL sweepAngle)
{
return AddPie(rect.X,
rect.Y,
rect.Width,
rect.Height,
startAngle,
sweepAngle);
}
Status AddPie(IN INT x,
IN INT y,
IN INT width,
IN INT height,
IN REAL startAngle,
IN REAL sweepAngle)
{
return SetStatus(DllExports::GdipAddPathPieI(nativePath,
x,
y,
width,
height,
startAngle,
sweepAngle));
}
// float version
Status AddPolygon(IN const PointF* points,
IN INT count)
{
return SetStatus(DllExports::GdipAddPathPolygon(nativePath, points, count));
}
// integer version
Status AddPolygon(IN const Point* points,
IN INT count)
{
return SetStatus(DllExports::GdipAddPathPolygonI(nativePath, points, count));
}
Status AddPath(IN const GraphicsPath* addingPath,
IN BOOL connect)
{
GpPath* nativePath2 = NULL;
if(addingPath)
nativePath2 = addingPath->nativePath;
return SetStatus(DllExports::GdipAddPathPath(nativePath, nativePath2, connect));
}
// AddString point version
Status AddString(
IN const WCHAR *string,
IN INT length,
IN const FontFamily *family,
IN INT style,
IN REAL emSize, // In world units
IN const PointF &origin,
IN const StringFormat *format
)
{
RectF rect(origin.X, origin.Y, 0.0f, 0.0f);
return SetStatus(DllExports::GdipAddPathString(
nativePath,
string,
length,
family ? family->nativeFamily : NULL,
style,
emSize,
&rect,
format ? format->nativeFormat : NULL
));
}
// AddString rectangle version
Status AddString(
IN const WCHAR *string,
IN INT length,
IN const FontFamily *family,
IN INT style,
IN REAL emSize, // In world units
IN const RectF &layoutRect,
IN const StringFormat *format
)
{
return SetStatus(DllExports::GdipAddPathString(
nativePath,
string,
length,
family ? family->nativeFamily : NULL,
style,
emSize,
&layoutRect,
format ? format->nativeFormat : NULL
));
}
Status AddString(
IN const WCHAR *string,
IN INT length,
IN const FontFamily *family,
IN INT style,
IN REAL emSize, // In world units
IN const Point &origin,
IN const StringFormat *format
)
{
Rect rect(origin.X, origin.Y, 0, 0);
return SetStatus(DllExports::GdipAddPathStringI(
nativePath,
string,
length,
family ? family->nativeFamily : NULL,
style,
emSize,
&rect,
format ? format->nativeFormat : NULL
));
}
// AddString rectangle version
Status AddString(
IN const WCHAR *string,
IN INT length,
IN const FontFamily *family,
IN INT style,
IN REAL emSize, // In world units
IN const Rect &layoutRect,
IN const StringFormat *format
)
{
return SetStatus(DllExports::GdipAddPathStringI(
nativePath,
string,
length,
family ? family->nativeFamily : NULL,
style,
emSize,
&layoutRect,
format ? format->nativeFormat : NULL
));
}
/**
* Transforms the path object
*/
Status Transform(IN const Matrix* matrix)
{
if(matrix)
return SetStatus(DllExports::GdipTransformPath(nativePath, matrix->nativeMatrix));
else
return Ok; // No need to transform.
}
/**
* Get the bounds of the path object with the given transform.
* This is not always the tightest bounds.
*
* Defined in GdiplusGraphics.h.
*/
Status GetBounds(OUT RectF* bounds,
IN const Matrix* matrix = NULL,
IN const Pen* pen = NULL) const;
// integer version (defined in GdiplusGraphics.h)
Status GetBounds(OUT Rect* bounds,
IN const Matrix* matrix = NULL,
IN const Pen* pen = NULL) const;
/**
* Flatten the path object
* Once this is called, the resultant path is made of line segments and
* the original path information is lost.
* When matrix = NULL, the identity matrix is assumed.
*/
Status Flatten(IN const Matrix* matrix = NULL,
IN REAL flatness = FlatnessDefault)
{
GpMatrix* nativeMatrix = NULL;
if(matrix)
{
nativeMatrix = matrix->nativeMatrix;
}
return SetStatus(DllExports::GdipFlattenPath(
nativePath,
nativeMatrix,
flatness
));
}
#ifdef DCR_USE_NEW_202903
Status Widen(
IN const Pen* pen,
IN const Matrix* matrix = NULL,
IN REAL flatness = FlatnessDefault
)
{
GpMatrix* nativeMatrix = NULL;
if(matrix)
nativeMatrix = matrix->nativeMatrix;
return SetStatus(DllExports::GdipWidenPath(
nativePath,
pen->nativePen,
nativeMatrix,
flatness
));
}
#else
/**
* Widen the path object
* When removeSelfIntersects is TRUE, this returns the widened path
* without self intersections.
* When it is FALSE, it returns the widened path with selfintersections.
* The latter is faster and is usually safficient for filling.
*/
Status Widen(IN const Pen* pen,
IN const Matrix* matrix = NULL,
IN BOOL removeSelfIntersects = TRUE)
{
GpMatrix* nativeMatrix = NULL;
if(matrix)
nativeMatrix = matrix->nativeMatrix;
return SetStatus(DllExports::GdipWidenPathWithMinimumResolutions(nativePath, pen->nativePen,
0, 0, nativeMatrix, removeSelfIntersects));
}
/**
* Widen the path object
* This is equivalent to Widen() method except that
* The widths of the widened path are larger than the given
* minimum resolutions in x and y coordinates after the transform.
* This is usefull when widening a path with the limited device resolutions.
*/
Status Widen(IN const Pen* pen,
IN REAL minXres,
IN REAL minYres,
IN const Matrix* matrix = NULL,
IN BOOL removeSelfIntersects = TRUE)
{
GpMatrix* nativeMatrix = NULL;
if(matrix)
nativeMatrix = matrix->nativeMatrix;
return SetStatus(DllExports::GdipWidenPathWithMinimumResolutions(nativePath, pen->nativePen,
minXres, minYres, nativeMatrix, removeSelfIntersects));
}
#endif // DCR_USE_NEW_202903
Status Outline(
IN const Matrix *matrix = NULL,
IN REAL flatness = FlatnessDefault
)
{
GpMatrix* nativeMatrix = NULL;
if(matrix)
{
nativeMatrix = matrix->nativeMatrix;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -