unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, cxGraphics, cxLookAndFeels, cxLookAndFeelPainters,
Menus, ImgList, StdCtrls, cxButtons;
type
TForm1 =
class(TForm)
Zeichenflaeche: TPaintBox;
Panel: TPanel;
FarbeBTN: TcxButton;
cxButton1: TcxButton;
cxImageList1: TcxImageList;
procedure ZeichenflaechePaint(Sender: TObject);
procedure ZeichenflaecheMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure ZeichenflaecheMouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
private
{ Private-Deklarationen }
Draw : boolean;
BeginP : TPoint;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ZeichenflaechePaint(Sender: TObject);
begin
Zeichenflaeche.Canvas.Brush.Color := clWhite;
Zeichenflaeche.Canvas.FillRect(Zeichenflaeche.ClientRect);
end;
procedure TForm1.ZeichenflaecheMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
draw := true;
BeginP.X := X;
BeginP.Y := Y;
end;
procedure TForm1.ZeichenflaecheMouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer);
var pt: TPoint;
begin
if draw
then
begin
pt := Mouse.CursorPos;
Zeichenflaeche.Canvas.lineTo(x,y);
end;
end;
end.