unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    procedure Button4Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin
for i:=1 to 10000 do
  Canvas.Pixels[Random(ClientWidth), Random(ClientHeight)]:=
  RGB( Random(255),Random(255), Random (255 ) );
end;

procedure TForm1.Button2Click(Sender: TObject);
var
prost: TRect;
begin
   prost:= Rect(200,10,300,100);
   Canvas.Brush.Color := clBlack;
   //ramka
   Canvas.FrameRect(prost);
   Canvas.Brush.Color := clGreen;
   //prostokąt wypełniony
   Canvas.Rectangle(200,120,300,210);
   //prostokąt z zaokrąglonymi brzegami
   Canvas.RoundRect(200,230,300,320,20,20);
end;

procedure TForm1.Button3Click(Sender: TObject);
var x,y:integer;
begin
   Canvas.Font.Name:='Arial';
   Canvas.Font.Color:=ClBlue;
   Canvas.Font.Size:=24;
   Canvas.Brush.Style:=bsClear;
   x:=ClientWidth-Canvas.TextWidth('Zadania z Delphi');
   y:=ClientHeight-Canvas.TextHeight('Z');
  Canvas.TextOut(x div 2, y div 2,'Zadania z Delphi');
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
//elipsa wpisana w prostokąt o rozmiarach formularza
Canvas.Ellipse(0,0, ClientWidth, ClientHeight);
end;

end.
