Урок на Делфи 70. Рсуем флаг России


задание на delphi. Нарисать флаг России

unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls,Math,
Vcl.Grids;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
x,y,z:integer;
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
Canvas.Pen.Width:=1;
Canvas.Pen.Color:=clBlack;
Canvas.Brush.Color:=clWhite;
canvas.Rectangle(0,0,600,100);
canvas.Rectangle(0,100,600,200);
canvas.Rectangle(0,200,600,300);
for I := 0 to 100000 do
begin
Canvas.Pixels[RandomRange(0,600), RandomRange(100,200)]:=clBlue;
end;
for I := 0 to 100000 do
begin
Canvas.Pixels[RandomRange(0,600), RandomRange(200,300)]:=clRed;
end;
Canvas.Font.Size:=20;
Canvas.TextOut(270,300,'RUSSIA');
end;
end.



Скачать