Rubber Banding Example
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 run time. The example code is from a sample located in the <InstallDrive>\Documents and Settings\All Users\Documents\RAD Studio\<version>\Samples\Delphi\VCL\Graphex\ directory (click Start > Programs > Embarcadero RAD Studio > Samples). 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