Создайте программу преобразования движущегося графического изображения сектора из позитивной формы (серым цветом на синем фоне) в негативную форму и наоборот — Pascal(Паскаль)

uses crt,graph;
var gd,gm,x,y:integer;
    c:char;
    c1,c2:integer;
 
begin
gd:=detect;
Initgraph(gd,gm,'');
OutTextXY(200,20,'N/n-negativ, P/p-pozitiv, Vyhod-Esc');
x:=10;y:=240;
setcolor(7);
rectangle(0,150,640,350);
setfillstyle(1,7);
floodfill(5,155,7);
Setcolor(9);
PieSlice(x,y,60,120,50);
setfillstyle(1,9);
floodfill(x,y-10,9);
repeat
if keypressed then
 begin
  c:=readkey;
  case c of
  #80,#112:begin
           c1:=7;
           c2:=9;
           end;
  #78,#110:begin
           c1:=9;
           c2:=7;
           end;
  #27:exit;
  end;
 end;
delay(100);
setcolor(c1);
rectangle(0,150,640,350);
setfillstyle(1,c1);
floodfill(5,155,c1);
PieSlice(x,y,60,120,50);
setfillstyle(1,c1);
floodfill(x,y-10,c1);
x:=x+2;
setcolor(c1);
rectangle(0,150,640,350);
setfillstyle(1,c1);
floodfill(5,155,c1);
Setcolor(c2);
PieSlice(x,y,60,120,50);
setfillstyle(1,c2);
floodfill(x,y-10,c2);
if x>getmaxX then
 begin
  setcolor(7);
  rectangle(0,150,640,350);
  setfillstyle(1,7);
  floodfill(5,155,7);
  setcolor(12);
  settextstyle(0,0,2);
  outtextXY(50,getmaxY div 2,'Programma zavershwna, nazmite Esc');
end;
until c=#27;
end.

Leave a Comment

− 3 = 1