如何使用ArcTo函数绘制弧??? [英] How can use ArcTo function to draw arc???

查看:212
本文介绍了如何使用ArcTo函数绘制弧???的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
如何在MFC中绘制弧线?我尝试使用ArcTo(...)函数,但没有用.:confused:
这是我的代码:

hello,
How can draw arc in mfc? i try to use ArcTo(...) function but it didn''t work.:confused:
Here is my code:

BOOL CModlessDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	CClientDC d(this);
	d.ArcTo(20,30,30,45,20,60,45,20);
	return TRUE;  // return TRUE  unless you set the focus to a control 
}


请帮忙.
about


please help.
regard

推荐答案

看看这个链接,他们提供了一些很好的信息:

http://www.ucancode.net/faq/CDC_Arc_Pie_Chord.htm [
Have a look at this link, they give some good info:

http://www.ucancode.net/faq/CDC_Arc_Pie_Chord.htm[^]

By the way, shouldn''t you be drawing in the paint event? You now simply draw it once and will be erased (or not show up at all) if not redrawn in the paint event. Did you also try to draw some other shapes? Did you also define and use a Pen and Brush accordingly?

Good luck!


正如EF Nijboer所说,如果仅在OnInitDialog方法上绘制了椭圆,就没有机会在对话框中看到它:调用OnInitDialog时,该对话框尚不可见,然后在初始化代码后调用OnPain,并且您的图形会丢失!

此处 [
As E.F. Nijboer said, if you have drawn your ellipse only on the OnInitDialog method, you have no chance to see it on the dialog: when OnInitDialog is called, the dialog is not yet visible, then after your initialization code the OnPain is called and your drawings are lost!

Here[^] there is the MSDN documentation about ArcTo...


这篇关于如何使用ArcTo函数绘制弧???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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