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

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

Polygon的更多相关文章

  1. [LeetCode] Convex Polygon 凸多边形

    Given a list of points that form a polygon when joined sequentially, find if this polygon is convex ...

  2. 结合谷歌地图多边形(polygon)与Sql Server 2008的空间数据类型计算某个点是否在多边形内的注意事项

    首先在利用 GEOGRAPHY::STPolyFromText(@GeoStr, 4326) 这样的函数把字符串转换为Geography类型时,字符串里经纬度的顺序是 “经度[空格]纬度”,即“lon ...

  3. [svg 翻译教程]Polyline(折线)polygon(多边形)

    原文: http://tutorials.jenkov.com/svg/polygon-element.html Polyline 虽然说这个 元素我没用过,但是还是蛮强大的,也翻译下 示例 < ...

  4. [OpenGL][SharpGL]用Polygon Offset解决z-fighting和stitching问题

    [OpenGL][SharpGL]用Polygon Offset解决z-fighting和stitching问题 本文参考了(http://www.zeuscmd.com/tutorials/open ...

  5. WebGIS中基于AGS的画圆查询简析以及通过Polygon来构造圆的算法

    文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/. 1.背景 某个项目需求中需要在前端进行画圆查询,将圆范围上的多边形要素 ...

  6. 【ASC 23】G. ACdream 1429 Rectangular Polygon --DP

    题意:有很多棍子,从棍子中选出两个棍子集合,使他们的和相等,求能取得的最多棍子数. 解法:容易看出有一个多阶段决策的过程,对于每个棍子,我们有 可以不选,或是选在第一个集合,或是选在第二个集合 这三种 ...

  7. libgdx 裁剪多边形(clip polygon、masking polygon)

    直接放例子代码,代码中以任意四边形为例,如果需要做任意多边形,注意libgdx不能直接用ShapeRender填充多边形,需要先切割成三角形. public static void drawClip( ...

  8. Leetcode: Convex Polygon

    Given a list of points that form a polygon when joined sequentially, find if this polygon is convex ...

  9. 十五、polygon API

    How polygons are handled internally The five basic polygonal API classes Construction History and Tw ...

  10. [javascript svg fill stroke stroke-width points polygon属性讲解] svg fill stroke stroke-width points polygon绘制多边形属性并且演示polyline和polygon区别讲解

    <!DOCTYPE html> <html lang='zh-cn'> <head> <title>Insert you title</title ...

随机推荐

  1. eclipse tomcat maven

    jdk jre eclipse 略过 下载maven和tomcat 上apache官网下载maven:http://maven.apache.org/download.cgi. 上apache官网下载 ...

  2. SPOJ SUBLEX - Lexicographical Substring Search 后缀自动机 / 后缀数组

    SUBLEX - Lexicographical Substring Search Little Daniel loves to play with strings! He always finds ...

  3. 九度OJ 1076:N的阶乘 (数字特性、大数运算)

    时间限制:3 秒 内存限制:128 兆 特殊判题:否 提交:6384 解决:2238 题目描述: 输入一个正整数N,输出N的阶乘. 输入: 正整数N(0<=N<=1000) 输出: 输入可 ...

  4. 早一天把生意做到de

    const isMobilePhoneNum = (params) => { const areaCode = params.areaCode || 'cn' const str = param ...

  5. js为Object对象动态添加属性和值 eval c.k c[k]

    const appendInfo = () => { const API_SECRET_KEY = 'https://github.com/dyq086/wepy-mall/tree/maste ...

  6. PHP 格式化数字串

    在xls或csv文件中, 超过12位以上的数字会被"科学计数", 所以当php读取这些文件的时候, 会读成 420E+16 , 显然这不是我们想要的, 所以就要用到数字格式化了! ...

  7. 【题解】CF264B Good Sequences

    [题解]CF264B Good Sequences 具有很明显的无后效性. 考虑\(dp\). 考虑初始条件,显然是\(dp(0)=0\) 考虑转移,显然是\(dp(t)=max(dp[k])+1\) ...

  8. 一步步玩pcDuino3--mmc下的裸机流水灯

            第一部分是玩pcduino3下的裸机.这个过程能够让我们更好的理解嵌入式系统,熟悉我们使用的这个平台.         首先介绍下开发环境: 虚拟机:VMware® Workstati ...

  9. php微信支付测试开发(流程已通)

    必要条件: appid //公众号后台开发者中心获得(和邮件内的一样)   mchid//邮件内获得  key//商户后台自己设置  appsecret //公众号开发者中心获得 两个证书文件,邮件内 ...

  10. 转换(旋转)transform

    div { transform:rotate(180deg); -ms-transform:rotate(180deg); /* IE 9 */ -moz-transform:rotate(180de ...