Topshiriqlarni bajarish namunasi.
Topshiriq: Ekranning ixtiyoriy qismida paydo bo‘layotgan nuqta tasvirini yarating.
2. Dasturi.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var i,j:integer;
a:array[1..600] of integer;
begin
for i:=1 to 600 do
begin
a[i]:=i;
end;
for i:=1 to 4000 do
begin
Form1.Canvas.Pen.Color:=clblue;
Form1.Canvas.Pen.Width:=10;
Form1.Canvas.Pixels[random(a[i]),random(a[i])-100] := clblue;
for j:=1 to 50000000 do
begin
end;
Form1.Canvas.Pixels[random(a[i]),random(a[i])] :=clbtnface;
end;
end;
end.
Do'stlaringiz bilan baham: |