Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics 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 January 27th, 2004, 12:29 AM
Authorized User
 
Join Date: Jan 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Drawing Rectangles

Hi there,
         I have a question on the drawing of rectangles or any other geometric shapes on a graphics object. My code draws a rectagle by first picking a point at the with a mouse down event. The second point is picked by the following mouse up event. The rectangle draws eventually. However, I can't see the shape of the rectangle growing or shrinking from the first point as I move my mouse on the graphics. The rectangle only appears after I have picked the second point.
 Is there anyway to fix this?

Thanks,
Dinesh

 
Old January 27th, 2004, 10:53 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I don't think there is a fix for this because it's not really a problem. You will have to program this into your application. I'm not real familiar with writing graphics applications but I would imagine that you would need to draw and clear many rectangles while you are moving the mouse around after the mouse down event, but before the mouse up event. I would think that you would need to do this drawing of the rectangle on a different layer of the canvas so you can clear the layer and redraw with each mouse movement. You won't be able to clear the rectangle that you have drawn onto a layer with existing content, otherwise you'll loose what's "under" the rectangle when you clear it. I don't know if the .net drawing classes support multi layer drawing and all that goes along with that, but that's how I would imagine it working.

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Drawing Shapes cbulutlar Javascript 2 March 6th, 2006 02:25 PM
drawing fergo Access VBA 0 June 6th, 2005 12:35 PM
drawing fergo BOOK: Access 2003 VBA Programmer's Reference 1 June 5th, 2005 09:32 AM
Drawing in C# stripytiger VS.NET 2002/2003 4 August 25th, 2004 10:01 AM





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