procedure
TForm1
.
Button1Click(Sender: TObject);
var
x,x1,x2,y,y1,y2:
integer
;
begin
x1:=strtoint(edit1
.
text);
x2:=strtoint(edit2
.
text);
y1:=strtoint(edit3
.
text);
y2:=strtoint(edit4
.
text);
if
(x1<x2)
and
(y1=y2)
then
for
x:=x1
to
x2
do
Form1
.
Canvas
.
Pixels[x,y]:=clBlack;
if
(y1<y2)
and
(x1=x2)
then
for
y:=y1
to
y2
do
Form1
.
Canvas
.
Pixels[x,y]:=clBlack;
if
(x1>x2)
and
(y1=y2)
then
for
x:=x1
downto
x2
do
Form1
.
Canvas
.
Pixels[x,y]:=clBlack;
if
(y1>y2)
and
(x1=x2)
then
for
y:=y1
downto
y2
do
Form1
.
Canvas
.
Pixels[x,y]:=clBlack;
if
(x1<>x2)
and
(y1<>y2)
then
ShowMessage(
'Начальные и конечные значения одной из осей должны быть равны!'
);
end
;