Wrox Programmer Forums
|
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 12th, 2005, 10:48 PM
Registered User
 
Join Date: Feb 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Draw Circle using mouse

How do i use mouse drag to draw circle? Currently i only know how to use Eclipse(x1,y1,x2,y2) but it uses fixed coordinates to draw. I need the codes for using mouse to draw. thanx alot.

 
Old September 1st, 2005, 05:42 PM
Authorized User
 
Join Date: Jul 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to merediths
Default


You need to change your coordinates inside your even loop when you recienve mouse events:

{
 static int start_x;
 static int start_y;
 int mx, my;
...
...

case WM_MOUSEMOVE:
  mx = GET_X_LPARAM(lParam);
  my = GET_Y_LPARAM(lParam);
  break;
...
...

Eclipse(start_x, start_y,mx,my);
...
...

Regards,
Meredith Shaebanyan







Similar Threads
Thread Thread Starter Forum Replies Last Post
Image animation that move in a round circle Andraw Other Programming Languages 7 October 13th, 2008 07:39 AM
drawing circle after prompting user Lizane Java GUI 1 June 18th, 2007 09:19 AM
Draw Line talktorajeev C# 1 May 18th, 2006 08:35 AM
How To Draw Using Slago VS.NET 2002/2003 0 March 20th, 2006 09:25 AM
SetTimeout Image Cycling in Circle sasidhar79 Javascript 7 July 3rd, 2004 12:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.