Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to draw basic shapes?

Status
Not open for further replies.

aryajur

Programmer
Jul 2, 2003
45
US
Hello,
I need to draw some basic shapes, especially quadilaterals given the 4 input co ordinates of it. How should I go about it. Can anybody give me any example code for this? I know nothing about graphics programming in VC++ I have only done graphics programming in Turbo C++. Please suggest some good links to learn this and get example codes.
 
Look in msdn.microsoft.com. There should eb many articles and books on Win32API, MFC ...

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
To draw any many sided figure, set up an array of POINT structures that hold the coordinates of the vertices. Then in your WM_PAINT case, use MoveTo() (could be MoveToEx() - check your Win32 API manual) with the first coordinate to start off. Then do a for loop over the remaining points with LineTo()(LineToEx()?). Add one more LineTo() with the starting point to close the figure. Should work fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top