首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

c++怎么画实心的箭头

2013-10-22 
c++如何画实心的箭头 CDC *pDC GetDC()CRect rectGetClientRect(rect)//获得用户区域大小CPen penBlu

c++如何画实心的箭头

 CDC *pDC = GetDC();         CRect rect;   GetClientRect(rect);  //获得用户区域大小            CPen penBlue(PS_SOLID, 1, RGB(0, 0, 255));          CPen* pOldPen = pDC->SelectObject(&penBlue);    //蓝笔红刷          CBrush brushRed(RGB(255, 255, 255));           CBrush* pOldBrush = pDC->SelectObject(&brushRed);            CPoint pts[7];            pts[0].x = rect.top;           pts[0].y = rect.left + rect.Height()/2;            pts[1].x = rect.Width()/2;           pts[1].y = rect.top ;           pts[2].x = pts[1].x;           pts[2].y = rect.Height()/3;           pts[3].x = rect.right;           pts[3].y = pts[2].y;           pts[4].x = pts[3].x ;           pts[4].y = rect.Height()*2/3;           pts[5].x = rect.Width()/2;           pts[5].y = pts[4].y;          pts[6].x = pts[5].x;           pts[6].y = rect.bottom;          pDC->Polygon(pts, 7);   // Put back the old objects.          pDC->SelectObject(pOldPen);           pDC->SelectObject(pOldBrush);

热点排行