GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 26-Jun-2008, 18:30
degs2k4 degs2k4 is offline
New Member
 
Join Date: Jun 2008
Posts: 1
degs2k4 is on a distinguished road
Unhappy

Draw, drag & drop lines in a Picture Control


Hello,

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  
Old 27-Jun-2008, 08:10
fakepoo fakepoo is offline
Regular Member
 
Join Date: Oct 2007
Posts: 761
fakepoo is a jewel in the roughfakepoo is a jewel in the roughfakepoo is a jewel in the rough

Re: Draw, drag & drop lines in a Picture Control


My 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  
Old 07-Apr-2009, 14:51
ashuu ashuu is offline
New Member
 
Join Date: Apr 2009
Posts: 1
ashuu is on a distinguished road

Re: Draw, drag & drop lines in a Picture Control


how can i draw a line in opengl with mouse click and drag
 
 

Recent GIDBlogVista ?Widgets? on Windows XP by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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

All times are GMT -6. The time now is 06:36.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.