Polygon
2024-09-08 05:36:11
用当前的笔绘制一个由两个或多个点(顶点)连接的多边形。
BOOL Polygon(
LPPOINT lpPoints,
int nCount
);
lpPoints
指向一个指定多边形顶点的点。数组中的每一点都是一个点结构或一个CPoint对象。
nCount
指定数组中顶点的数量。
返回值
如果函数成功,则非零;否则0。
void CDCView::DrawPolygon(CDC* pDC)
{
// find the client area
CRect rect;
GetClientRect(rect); // draw with a thick blue pen
CPen penBlue(PS_SOLID, , RGB(, , ));
CPen* pOldPen = pDC->SelectObject(&penBlue); // and a solid red brush
CBrush brushRed(RGB(, , ));
CBrush* pOldBrush = pDC->SelectObject(&brushRed); // Find the midpoints of the top, right, left, and bottom
// of the client area. They will be the vertices of our polygon.
CPoint pts[];
pts[].x = rect.left + rect.Width()/;
pts[].y = rect.top; pts[].x = rect.right;
pts[].y = rect.top + rect.Height()/; pts[].x = pts[].x;
pts[].y = rect.bottom; pts[].x = rect.left;
pts[].y = pts[].y; // Calling Polygon() on that array will draw three lines
// between the points, as well as an additional line to
// close the shape--from the last point to the first point
// we specified.
pDC->Polygon(pts, ); // Put back the old objects.
pDC->SelectObject(pOldPen);
pDC->SelectObject(pOldBrush);
}
最新文章
- c++设计模式之单例模式下的实例自动销毁(垃圾自动回收器)
- .NET破解之太乐地图下载器【非暴破】
- LINUX信息安全系统设计基础第一周学习总结
- git对象存储
- oracle 分布式数据库
- unmount的时候报错
- 由link()和symlink()谈到软链接与硬链接
- Android开发之漫漫长途 ⅥI——Android消息机制(Looper Handler MessageQueue Message)
- Android View的事件冲突
- Linux基础入门-用户及文件权限管理
- [Draft]iOS.ObjC.Pattern.Builder-Pattern
- mysql查询同一个字段下,不同内容的语句
- img 标签的 usemap 属性
- 关于Mac OS虚拟机下共享文件夹的方法
- ios中UIWebview和asiHttprequest的用法
- python 读写压缩文件
- hdu6398 计算几何
- HDU 2895 贪心 还是 大水题
- Framwork框架日志与配置工具的使用
- tp5 常见问题 模板文件 路由