471,337 Members | 859 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

Geometrics forms...

Hi,

I have to draw a geometric form quite complex, like a car for example.
Then, i need to know which part of the car the user has clicked on.

In vb6 i would have used the "shapes" component to draw the car and then use
a mathemtical formula to test if the user is in or out of the car.

In C#, i don't see any componant to draw geometric forms at design time.
Is there any ?
Is there a best solution in C# ?

Thanks !

Dec 5 '05 #1
4 1505
Steven wrote:
Hi,

I have to draw a geometric form quite complex, like a car for example.
Then, i need to know which part of the car the user has clicked on.

In vb6 i would have used the "shapes" component to draw the car and then use
a mathemtical formula to test if the user is in or out of the car.

In C#, i don't see any componant to draw geometric forms at design time.
Is there any ?
Is there a best solution in C# ?


I'd create user controls (or maybe only one for the whole car), override
OnPaint(..) and do the drawing myself. Most drawing functions are a
matter of calling _one_ function on the e.Graphics object, thus being
almost as simple as in VB6, yet much more flexible.

Also the GraphicsPath class contains a very useful function "IsVisible".
It checks if a Point is contained within a specified area. So you can
easily check if the mouse is over even very complex shapes, without
doing at math at all.

hth,
Max
Dec 5 '05 #2
Markus Stoeger wrote:
without doing at math at all.


should be: without doing "any" math at all
Dec 5 '05 #3
Thanks for your answer but even if i understand quite well "the way to use"
graphic functions, i'm not sure to get how to draw the car.
Do you mean that i need to describe it by giving each point's coordinates in
the code ?

Is there any way to draw it directly with my mouse like with the paint
software of windows or like the Shapes componant in VB6 ?

Thanks again.
Dec 5 '05 #4
In my signature is a link to a commercial component that integrates in
Visual Studio .NET. It is much more than the Shapes component.

Regards,
Frank Hileman

check out VG.net: http://www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor

"Steven" <no**@none.com> wrote in message
news:O1****************@TK2MSFTNGP14.phx.gbl...
Thanks for your answer but even if i understand quite well "the way to
use" graphic functions, i'm not sure to get how to draw the car.
Do you mean that i need to describe it by giving each point's coordinates
in the code ?

Is there any way to draw it directly with my mouse like with the paint
software of windows or like the Shapes componant in VB6 ?

Thanks again.

Dec 5 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Joshua Russell | last post: by
15 posts views Thread by Joshua Kendall | last post: by
3 posts views Thread by Lloyd Sheen | last post: by
3 posts views Thread by Geraldine Hobley | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.