1
Answer

How i can select and drag an object graphics on screen by clicking mouse on it

Nguen  trang

Nguen trang

17y
2.1k
1
Hi,
I'm a beginer of learning GDI+ in c#. I don't know how i can select and drag an object graphics as line or rectangle on the screen by clicking mouse on it. I need to help. Thanks a lot. 
Answers (1)
0
Richard Blythe

Richard Blythe

NA 101 0 17y
First, I would strongly recommend that you buy a book on C# graphics.  A company called "Apress" has several good books on graphics.  What you are trying to accomplish can be done by a proccess called hit testing.  You would then calculate the position of the mouse in relation to where the object is currently drawn.  Then trap the mouse move event on the form and then do a million other things.  :->  No, it ain't that hard but you definitely need to get a good book on graphics.

Cheers!
  Richard