用当前的笔绘制一个由两个或多个点(顶点)连接的多边形。

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);
}

最新文章

  1. c++设计模式之单例模式下的实例自动销毁(垃圾自动回收器)
  2. .NET破解之太乐地图下载器【非暴破】
  3. LINUX信息安全系统设计基础第一周学习总结
  4. git对象存储
  5. oracle 分布式数据库
  6. unmount的时候报错
  7. 由link()和symlink()谈到软链接与硬链接
  8. Android开发之漫漫长途 ⅥI——Android消息机制(Looper Handler MessageQueue Message)
  9. Android View的事件冲突
  10. Linux基础入门-用户及文件权限管理
  11. [Draft]iOS.ObjC.Pattern.Builder-Pattern
  12. mysql查询同一个字段下,不同内容的语句
  13. img 标签的 usemap 属性
  14. 关于Mac OS虚拟机下共享文件夹的方法
  15. ios中UIWebview和asiHttprequest的用法
  16. python 读写压缩文件
  17. hdu6398 计算几何
  18. HDU 2895 贪心 还是 大水题
  19. Framwork框架日志与配置工具的使用
  20. tp5 常见问题 模板文件 路由

热门文章

  1. Python学习笔记18:标准库之多进程(multiprocessing包)
  2. EasyPlayer Android安卓RTSP服务器低延时再优化策略
  3. imagick图片压缩。
  4. cron表达式(转)
  5. matlab vs使用
  6. [2018-05-27]配置VSTS认证方式使用Personal Access Token
  7. 在Spring中基于JDBC进行数据访问时如何控制超时
  8. MySQL 中事务的实现
  9. 如何设置确认selinux 模式【转】
  10. 关于RabbitMQ简介