RAD Studio |  |

Rubber Banding Example
See Also
Collapse All

This example describes the details of implementing the "rubber banding" effect in an graphics application that tracks mouse movements as the user draws a graphic at runtime. The example code covered in this topic is taken from a sample application located in the Demos\Doc\Graphexdirectory. The application draws lines and shapes on a window's canvas in response to clicks and drags: pressing a mouse button starts drawing, and releasing the button ends the drawing.

To start with, the example code shows how to draw on the surface of the main form. Later examples demonstrate drawing on a bitmap.

The following topics describe the example:

- Responding to the mouse.
- Adding a field to a form object to track mouse actions.
- Refining line drawing.

See Also

Overview of Graphics Programming

Using the Properties of the Canvas Object

Using Canvas Methods to Draw Graphic Objects

Handling Multiple Drawing Objects in Your Application

Drawing on a Bitmap

Loading and Saving Graphics Files

Using the Clipboard with Graphics

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!