By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,344 Members | 1,853 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,344 IT Pros & Developers. It's quick & easy.

How do I draw primitive shapes in VC++

P: 2
Hi,
I just want to draw primitive shapes like lines,circles,rectangles etc.
I found a method :
Graphics.drawline(Pen,x1,y1,x2,y2)

The code I used is as follows:

Pen blackPen = gcnew Pen( Color::Black,3.0f );
Point point1 = Point(100,100);
Point point2 = Point(500,100);
Graphics.DrawLine( blackPen, 10,10,50,70 );

I get the error that :'Pen' : undeclared identifier
I tried to find the header file in which Pen is present,but couldn't find one.
Please tell me what header files should I use to run this code ?

Thanks.
Nov 9 '06 #1
Share this Question
Share on Google+
2 Replies


sivadhas2006
100+
P: 142
Hi,

r u using MFC?

Regards,
M.Sivadhas.
Nov 9 '06 #2

P: 2
Hi,

r u using MFC?

Regards,
M.Sivadhas.

Yes, I do.
Nov 9 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.