From: "Claire" Newsgroups: borland.public.delphi.graphics References: <3bd0a915$1_1@dnews> Subject: Re: Temporary lines Date: Sun, 21 Oct 2001 19:27:01 +0100 Lines: 61 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 213.106.1.11 Message-ID: <3bd312fe_1@dnews> X-Trace: dnews 1003688702 213.106.1.11 (21 Oct 2001 11:25:02 -0700) Path: dnews Xref: dnews borland.public.delphi.graphics:43003 Ive used drawfocusrect here for speed, but you could draw using some other method. :) procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin MouseDown := true; lastx1 := x; lasty1 := y; lastx2 := x; lasty2 := y; end; procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin if MouseDown then begin drawfocusrect(canvas.handle,Rect(lastx1,lasty1,lastx2,lasty2)); lastx2 := x; lasty2 := y; drawfocusrect(canvas.handle,Rect(lastx1,lasty1,lastx2,lasty2)); end; end; procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if mousedown then begin MouseDown := false; drawfocusrect(canvas.handle,Rect(lastx1,lasty1,lastx2,lasty2)); end; end; procedure TForm1.FormCreate(Sender: TObject); begin MouseDown := false; end; -- Claire Humphrey Software Engineer "Felipe Monteiro de Carvalho" wrote in message news:3bd0a915$1_1@dnews... > Hi everyone, > > Every good image editor shows preview lines (or squares, etc.) so that > you can know what you are doing. How do I do it (specificaly between > MouseDown and MouseUp)? > > Thanks. > >