GDI in C++

A

AsusUltra

Hey, im a newby C++ programmer trying to create a function that will
draw a Polygonal shape on a Windows Form:

Void DrawRegPoly(int numSides, Point CenterCoord, double radius)
{
//I dont know what to do here!
}

I'm trying to make this function as flexible as possible, if theres 8
sides, and the center coordinate is (10,10), and the radius is 2, then
the hexagon shape:

__
/ \
| * | // the 8 vertices should be 2 from the
center coord, with 8 sides
\__/ /* should expand (side lengths) and be in
different location if args set at:
numSides=8, CenterCoord(60,60),
radius =60
should be diff shape if numSides = 10 or 20
or 60 */

yeah..i donk know much about GDI+ but this would help a lot in the
program im writin..
 
A

Alf P. Steinbach

* AsusUltra:
Hey, im a newby C++ programmer trying to create a function that will
draw a Polygonal shape on a Windows Form:

Void DrawRegPoly(int numSides, Point CenterCoord, double radius)
{
//I dont know what to do here!
}

I'm trying to make this function as flexible as possible, if theres 8
sides, and the center coordinate is (10,10), and the radius is 2, then
the hexagon shape:

__
/ \
| * | // the 8 vertices should be 2 from the
center coord, with 8 sides
\__/ /* should expand (side lengths) and be in
different location if args set at:
numSides=8, CenterCoord(60,60),
radius =60
should be diff shape if numSides = 10 or 20
or 60 */

yeah..i donk know much about GDI+ but this would help a lot in the
program im writin..

[comp.lang.c++] is about the C++ language.

Your question is about Windows programming, although for those
knowledgable about Windows programming, it is about a particular Windows
C++ library (one that AFAIK only exists for one particular compiler!).

In other words, it's off-topic here.

So you're much better off asking in a Windows programming group.

The FAQ lists a number of relevant Windows programming groups; see the
FAQ (which you should do anyway before posting!).

But please don't feel unwelcome.

Just read the articles to get familiar with the group, read or at least
browse the FAQ, then post or answer some C++ question! :)

Cheers, & hth.

- Alf
 
V

Victor Bazarov

AsusUltra said:
Hey, im a newby C++ programmer trying to create a function that will
draw a Polygonal shape on a Windows Form:

Void DrawRegPoly(int numSides, Point CenterCoord, double radius)
{
//I dont know what to do here!

Get yourself a copy of a Windows programming book and read the
chapter on GDI. It's that simple!

Also, your question has nothing to do with C++. Essentially all
Windows programming is the same with many different languages, MS
created bindings for most common programming languages like C,
Fortran, Basic, Pascal, Python (well, MS didn't, others did)...
}

I'm trying to make this function as flexible as possible, if theres 8
sides, and the center coordinate is (10,10), and the radius is 2, then
the hexagon shape:
[..]
yeah..i donk know much about GDI+ but this would help a lot in the
program im writin..

If you need help with understanding some functions, you still
need to learn them (or about them), and then ask in the newsgroup
that deals with Windows programming. See comp.os.ms-windows.*
hierarchy.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
474,201
Messages
2,571,048
Members
47,647
Latest member
NelleMacy9

Latest Threads

Top