![]() |
|
#1
|
|||
|
|||
Draw, drag & drop lines in a Picture ControlHello,
In VS2005, I have a subclassed Picture Control (CStatic) where I can draw lines by left-button clicking, holding, and moving the mouse. But now, I want to click over one of those lines and "drag it" by just moving the mouse. Is it possible only by using MFC, or I should use other libraries like OpenGL ? Thanks ! |
|||
|
#2
|
|||
|
|||
Re: Draw, drag & drop lines in a Picture ControlMy guess is that you draw the lines in the MouseMove or MouseDown/Up event handlers? What you'll want to do instead of drawing them there, draw them in the OnPaint event handler. In the Mouse handlers, simply save the coordinates in a data structure and in the OnPaint handler, draw every line. This way, you now have the coordinates and you can choose to alter them to move a line. Does this make sense?
|
|
#3
|
|||
|
|||
Re: Draw, drag & drop lines in a Picture Controlhow can i draw a line in opengl with mouse click and drag
|
Recent GIDBlog
Vista ?Widgets? on Windows XP by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to change the picture of a picture control | manmfc | MS Visual C++ / MFC Forum | 0 | 30-Apr-2008 01:02 |
| MFC + Windows CE + Picture control | gam101 | MS Visual C++ / MFC Forum | 0 | 07-Aug-2007 09:19 |
| Clearing a Picture Control | br.ramanand | MS Visual C++ / MFC Forum | 2 | 22-Jul-2007 20:37 |
| Problem with draw lines using MFC | puzz | MS Visual C++ / MFC Forum | 3 | 26-Apr-2005 20:15 |
| Help! Some basal questions about MFC | xutingnjupt | MS Visual C++ / MFC Forum | 1 | 05-Dec-2004 03:38 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The