//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "LineTo.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: LineTo
// Method: Graphics.TCanvas.MoveTo
// Method: Graphics.TCanvas.LineTo

// BeginCode
/*
The following code draws a line from the upper left corner 
of a form to the mouse position when the mouse is moved, 
creating a "rubber band" effect.
*/
void __fastcall TForm1::FormMouseMove(TObject *Sender, TShiftState Shift, int X, int Y)
{
  /* first call FillRect to paint the surface of the form.
  this removes any previously drawn lines (and anything else!) */
  Canvas->FillRect(ClientRect);
  Canvas->MoveTo(0, 0);
  Canvas->LineTo(X, Y);
}
// EndCode
// EndExample: LineTo
//---------------------------------------------------------------------------
