pascalabcnet/InstallerSamples/Graphics/GraphABCLinux/Stamps/Stamp4.pas
Mikhalkovich Stanislav 6e34bc00fa TeacherControlPlugin в проекте
GraphABCLinux
Поправил иконку PABCHealth
Изменения в LightPT.pas
Цветной вывод в окне вывода (только для Windows)
Console.OutputEncoding := new System.Text.UTF8Encoding(false); в __RedirectIOMode.pas чтобы в Linux нормально выводилось
2022-07-10 14:51:51 +03:00

39 lines
846 B
ObjectPascal
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Класс штампа прямоугольника с методами увеличения-уменьшения от центра
uses GraphABCLinux;
type
RectangleStamp = class
x,y,w,h: integer;
constructor (xx,yy,ww,hh: integer);
begin
x := xx; y := yy;
w := ww; h := hh;
end;
procedure Stamp;
begin
Rectangle(x,y,x+w,y+h);
end;
procedure IncreaseFromCenter(dw: integer);
begin
w += dw*2; h += dw*2;
x -= dw; y -= dw;
end;
procedure DecreaseFromCenter(dw: integer);
begin
IncreaseFromCenter(-dw);
end;
procedure MoveOn(dx,dy: integer);
begin
x += dx; y += dy;
end;
end;
begin
var r := new RectangleStamp(100,100,300,300);
r.Stamp;
while r.w>2 do
begin
r.DecreaseFromCenter(4);
r.Stamp;
end;
end.