Click here to Skip to main content
15,886,661 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
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.
Posted

C++
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
 
Share this answer
 
v2
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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900