使用DirectX功能的MFC Activex控件. [英] MFC activex control using directx features.

查看:155
本文介绍了使用DirectX功能的MFC Activex控件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想开发包含DirectX功能(如简单的线条和曲线绘制功能)的MFC Activex控件.如果有人知道如何处理表面和CDC,请回复.

Hi,
I want to develope MFC activex control that contains directx features (like simple line and curve drawing features). If any body knows how to handle the surface and CDC please reply. If you have any basic application please post it.

推荐答案

CDC dc;
HBRUSH br;
br.CreateSolidBrush(RGB(255,0,0));
dc.SelectObject(&br);
dc.Rectangle(100,150,200,300);
dc.Ellipse(150,200,300,400);
dc.LineTo(50,100);
dc.MoveTo(100,210);
this->Invalidate();//To call onpaint function


如果您要做的只是绘制直线和曲线,并且您没有复杂的查看要求,则DirectX会显得过大-只需使用GDI,或者GDI +

在OnPaint方法中创建一个CPaintDC,然后使用基本CDC类中的方法
if all you want to do is draw lines and curves, and you have no complex viewing requirements, DirectX is overkill - simply use GDI, or GDI+

Create a CPaintDC in your OnPaint method, then use the methods in the base CDC class


这篇关于使用DirectX功能的MFC Activex控件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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