首页 > 编程语言 > 详细

在C++中使用GDI+绘制带箭头的线,箭头大小可调

时间:2015-11-04 17:28:35      阅读:569      评论:0      收藏:0      [点我收藏+]

Graphics g(pDc->m_hDC);

g.SetSmoothingMode(SmoothingModeHighQuality);

Color* attibute_color=(Color*)m_attributes[1]->pData;
Color color(attibute_color->GetAlpha(),attibute_color->GetRed(),attibute_color->GetGreen(),attibute_color->GetBlue());
    int line_width=m_attributes[0]->intvalue;
Pen pen(color,line_width);

//设置箭头大小
AdjustableArrowCap cap(4,4,true);
pen.SetCustomEndCap(&cap);

CPoint srcpoint = GetSrcPoint();
CPoint destpoint = GetDestPoint();

g.DrawLine(&pen,srcpoint.x,srcpoint.y,destpoint.x,destpoint.y);

在C++中使用GDI+绘制带箭头的线,箭头大小可调

原文:http://www.cnblogs.com/ihaoqi/p/4936408.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!