/*
* gdipluspath.h
*
* GDI+ GraphicsPath class
*
* This file is part of the w32api package.
*
* Contributors:
* Created by Markus Koenig <markus@stber-koenig.de>
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#ifndef __GDIPLUS_PATH_H
#define __GDIPLUS_PATH_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif
#ifndef __cplusplus
#error "A C++ compiler is required to include gdipluspath.h."
#endif
// Note that some methods of GraphicsPath are implemented in gdiplusimpl.h.
// This avoids a cyclic dependency on Graphics and Pen.
class GraphicsPath: public GdiplusBase
{
friend class CustomLineCap;
friend class Graphics;
friend class GraphicsPathIterator;
friend class PathGradientBrush;
friend class Region;
public:
GraphicsPath(FillMode fillMode = FillModeAlternate):
nativePath(NULL), lastStatus(Ok)
{
lastStatus = DllExports::GdipCreatePath(fillMode, &nativePath);
}
GraphicsPath(const PointF *points, const BYTE *types, INT count,
FillMode fillMode = FillModeAlternate):
nativePath(NULL), lastStatus(Ok)
{
lastStatus = DllExports::GdipCreatePath2(
points, types, count, fillMode, &nativePath);
}
GraphicsPath(const Point *points, const BYTE *types, INT count,
FillMode fillMode = FillModeAlternate):
nativePath(NULL), lastStatus(Ok)
{
lastStatus = DllExports::GdipCreatePath2I(
points, types, count, fillMode, &nativePath);
}
~GraphicsPath()
{
DllExports::GdipDeletePath(nativePath);
}
GraphicsPath* Clone() const
{
GpPath *clonePath = NULL;
Status status = updateStatus(DllExports::GdipClonePath(
nativePath, &clonePath));
if (status == Ok) {
GraphicsPath *result = new GraphicsPath(clonePath, lastStatus);
if (!result) {
DllExports::GdipDeletePath(clonePath);
lastStatus = OutOfMemory;
}
return result;
} else {
return NULL;
}
}
Status AddArc(REAL x, REAL y, REAL width, REAL height,
REAL startAngle, REAL sweepAngle)
{
return updateStatus(DllExports::GdipAddPathArc(nativePath,
x, y, width, height, startAngle, sweepAngle));
}
Status AddArc(INT x, INT y, INT width, INT height,
REAL startAngle, REAL sweepAngle)
{
return updateStatus(DllExports::GdipAddPathArcI(nativePath,
x, y, width, height, startAngle, sweepAngle));
}
Status AddArc(const RectF& rect, REAL startAngle, REAL sweepAngle)
{
return updateStatus(DllExports::GdipAddPathArc(nativePath,
rect.X, rect.Y, rect.Width, rect.Height,
startAngle, sweepAngle));
}
Status AddArc(const Rect& rect, REAL startAngle, REAL sweepAngle)
{
return updateStatus(DllExports::GdipAddPathArcI(nativePath,
rect.X, rect.Y, rect.Width, rect.Height,
startAngle, sweepAngle));
}
Status AddBezier(REAL x1, REAL y1, REAL x2, REAL y2,
REAL x3, REAL y3, REAL x4, REAL y4)
{
return updateStatus(DllExports::GdipAddPathBezier(nativePath,
x1, y1, x2, y2, x3, y3, x4, y4));
}
Status AddBezier(INT x1, INT y1, INT x2, INT y2,
INT x3, INT y3, INT x4, INT y4)
{
return updateStatus(DllExports::GdipAddPathBezierI(nativePath,
x1, y1, x2, y2, x3, y3, x4, y4));
}
Status AddBezier(const PointF& pt1, const PointF& pt2,
const PointF& pt3, const PointF& pt4)
{
return updateStatus(DllExports::GdipAddPathBezier(nativePath,
pt1.X, pt1.Y, pt2.X, pt2.Y,
pt3.X, pt3.Y, pt4.X, pt4.Y));
}
Status AddBezier(const Point& pt1, const Point& pt2,
const Point& pt3, const Point& pt4)
{
return updateStatus(DllExports::GdipAddPathBezierI(nativePath,
pt1.X, pt1.Y, pt2.X, pt2.Y,
pt3.X, pt3.Y, pt4.X, pt4.Y));
}
Status AddBeziers(const PointF *points, INT count)
{
return updateStatus(DllExports::GdipAddPathBeziers(
nativePath, points, count));
}
Status AddBeziers(const Point *points, INT count)
{
return updateStatus(DllExports::GdipAddPathBeziersI(
nativePath, points, count));
}
Status AddClosedCurve(const PointF *points, INT count)
{
return updateStatus(DllExports::GdipAddPathClosedCurve(
nativePath, points, count));
}
Status AddClosedCurve(const Point *points, INT count)
{
return updateStatus(DllExports::GdipAddPathClosedCurveI(
nativePath, points, count));
}
Status AddClosedCurve(const PointF *points, INT count, REAL tension)
{
return updateStatus(DllExports::GdipAddPathClosedCurve2(
nativePath, points, count, tension));
}
Status AddClosedCurve(const Point *points, INT count, REAL tension)
{
return updateStatus(DllExports::GdipAddPathClosedCurve2I(
nativePath, points, count, tension));
}
Status AddCurve(const PointF *points, INT count)
{
return updateStatus(DllExports::GdipAddPathCurve(
nativePath, points, count));
}
Status AddCurve(const Point *points, INT count)
{
return updateStatus(DllExports::GdipAddPathCurveI(
nativePath, points, count));
}
Status AddCurve(const PointF *points, INT count, REAL tension)
{
return updateStatus(DllExports::GdipAddPathCurve2(
nativePath, points, count, tension));
}
Status AddCurve(const Point *points, INT count, REAL tension)
{
return updateStatus(DllExports::GdipAddPathCurve2I(
nativePath, points, count, tension));
}
Status AddCurve(const PointF *points, INT count, INT offset,
INT numberOfSegments, REAL tension)
{
return updateStatus(DllExports::GdipAddPathCurve3(
nativePath, points, count,
offset, numberOfSegments, tension));
}
Status AddCurve(const Point *points, INT count, INT offset,
INT numberOfSegments, REAL tension)
{
return updateStatus(DllExports::GdipAddPathCurve3I(
nativePath, points, count,
offset, numberOfSegments, tension));
}
Status AddEllipse(REAL x, REAL y, REAL width, REAL height)
{
return updateStatus(DllExports::GdipAddPathEllipse(nativePath,
x, y, width, height));
}
Status AddEllipse(INT x, INT y, INT width, INT height)
{
return updateStatus(DllExports::GdipAddPathEllipseI(nativePath,
x, y, width, height));
}
Status AddEllipse(const RectF& rect)
{
return updateStatus(DllExports::GdipAddPathEllipse(nativePath,
rect.X, rect.Y, rect.Width, rect.Height));
}
Status AddEllipse(const Rect& rect)
{
return updateStatus(DllExports::GdipAddPathEllipseI(nativePath,
rect.X, rect.Y, rect.Width, rect.Height));
}
Status AddLine(REAL x1, REAL y1, REAL x2, REAL y2)
{
return updateStatus(DllExports::GdipAddPathLine(nativePath,
x1, y1, x2, y2));
}
Status AddLine(INT x1, INT y1, INT x2, INT y2)
{
return updateStatus(DllExports::GdipAddPathLineI(nativePath,
x1, y1, x2, y2));
}
Status AddLine(const PointF& pt1, const PointF& pt2)
{
return updateStatus(DllExports::GdipAddPathLine(nativePath,
pt1.X, pt1.Y, pt2.X, pt2.Y));
}
Status AddLine(const Point& pt1, const Point& pt2)
{
return updateStatus(DllExports::GdipAddPathLineI(nativePath,
pt1.X, pt1.Y, pt2.X, pt2.Y));
}
Status AddLines(const PointF *points, INT count)
{
return updateStatus(DllExports::GdipAddPathLine2(nativePath,
points, count));
}
Status AddLines(const Point *points, INT count)
{
return updateStatus(DllExports::GdipAddPathLine2I(nativePath,
points, count));
}
Status AddPath(const GraphicsPath *addingPath, BOOL connect)
{
return updateStatus(DllExports::GdipAddPathPath(nativePath,
addingPath ? addingPath->nativePath : NULL,
connect));
}
Status AddPie(REAL x, REAL y, REAL width, REAL height,
REAL startAngle, REAL sweepAngle)
{
return updateStatus(DllExports::GdipAddPathPie(nativePath,
x, y, width, height, startAngle, sweepAngle));
}
Status AddPie(INT x, INT y, INT width, INT height,
REAL startAngle, REAL sweepAngle)
{
return updateStatus(DllExports::GdipAddPathPieI(nativePath,
x, y,
api-level.rar_Not Yet
版权申诉
49 浏览量
2022-09-19
22:13:10
上传
评论
收藏 8KB RAR 举报
weixin_42653672
- 粉丝: 93
- 资源: 1万+
最新资源
- cmak-3.0.0.6.zip
- Map2ShpPro-Demo.zip
- vue3 的 main.ts 文件,包含了 elementui-plus 注册,icon 全局注册等常用注册
- Typecho博客主题Joe素颜执念修改版
- SP8K32-TB-VB一款2个N-Channel沟道SOP8的MOSFET晶体管参数介绍与应用说明
- Alibaba 阿里P9百亿级高并发系统设计手册最新全彩PDF版本
- Socket通讯验证工具 可验证本机端口是否被占用 验证服务端端口是否开通或可访问 查看服务端与客户端的socket发送信息
- SP8K31-TB-VB一款2个N-Channel沟道SOP8的MOSFET晶体管参数介绍与应用说明
- 安卓AndroidStudio基于百度云平台人脸识别学生考勤签到系统
- 红外温度传感器的原理及应用
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈