unit mZeichenebene;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, jpeg, ExtCtrls, StdCtrls;
type
TZeichnenPanel =
class(TForm)
Image1: TImage;
Pain: TPaintBox;
Button1: TButton;
Button2: TButton;
Image2: TImage;
procedure PaintBox1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Image2Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
ZeichnenPanel: TZeichnenPanel;
implementation
{$R *.dfm}
procedure TZeichnenPanel.Button2Click(Sender: TObject);
begin
//
end;
procedure TZeichnenPanel.FormCreate(Sender: TObject);
begin
self.DoubleBuffered := true;
end;
procedure TZeichnenPanel.PaintBox1Click(Sender: TObject);
begin
Refresh;
with self.Pain
do begin
Canvas.Brush.Style := bsClear;
Canvas.Pen.Style := psSolid;
Canvas.Pen.Color := clred;
Canvas.Pen.Width := 2;
Canvas.Rectangle(50,50,ClientWidth, ClientHeight);
Canvas.Ellipse(1,1,ClientWidth, ClientHeight);
Canvas.MoveTO(1,ClientHeight
div 2);
Canvas.LineTo(ClientWidth, ClientHeight
div 2);
Canvas.MoveTo(ClientWidth
div 2, 1);
Canvas.LineTo(ClientWidth
div 2, ClientHeight);
end;
end;
procedure TZeichnenPanel.Image2Click(Sender: TObject);
begin
Refresh;
with self.Image2
do begin
//Canvas.Brush.Style := bsClear;
//Canvas.Pen.Style := psSolid;
//Canvas.Pen.Color := clred;
//Canvas.Pen.Width := 2;
Canvas.Rectangle(50,50,ClientWidth, ClientHeight);
Canvas.Ellipse(1,1,ClientWidth, ClientHeight);
Canvas.MoveTO(1,ClientHeight
div 2);
Canvas.LineTo(ClientWidth, ClientHeight
div 2);
Canvas.MoveTo(ClientWidth
div 2, 1);
Canvas.LineTo(ClientWidth
div 2, ClientHeight);
end;
end;
end.