如何在Visual C ++中绘制字段行? [英] how to draw filed lines in Visual C++ ?

查看:111
本文介绍了如何在Visual C ++中绘制字段行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i希望在VC ++中围绕许多物体(2D线条,线条,椭圆,多边形等)绘制场线(如磁力)。

可以帮我吗?



谢谢

Hi,
i want to draw field lines( like in magnetism) around many objects ( 2D draw like lines, rects, ellipses, polygones..) in VC++.
could please help me?

Thanks

推荐答案

Do the following code inside the OnPaint function:













CPaintDC d(this);
// Line
d.MoveTo(20,40);
d.LineTo(80,40);
// Rect
d.Rectangle(10,20,200,10);
// Round rect
d.RoundRect(10,120,200,220,20,20);
//ellipse
d.Ellipse(10,240,200,340);

//pie
d.Pie(250,10,350,110,350,110,350,10);
//polygon
POINT pt[5] = { 250,150,250,300,300,350,400,300,320,190};

d.Polygon(pt,5);


这篇关于如何在Visual C ++中绘制字段行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆