Program kr_kv; Uses Graph, max_crt; Var x1, x2, y1, y2 :integer; p: pointer; gd, gm: integer; size :word; arrow: char; Begin {Main} gd:=0; detectgraph(gd, gm); Initgraph(gd, gm, ''); if graphresult<>0 then Begin Write('osibka ',graphresult); halt end; SetBkColor(blue); SetFillStyle(solidfill, red); Cleardevice; x1:=10; y1:=10; x2:=50; y2:=40; Bar(x1, y1, x2, y2); size:=imagesize(x1, y1, x2, y2); Getmem(p, size); Getimage(x1, y1, x2, y2, p^); OuttextXY(300, 50, 'press arrows...'); Putimage(x1, y1, p^, 0); Repeat arrow:=readkey; case arrow of #72: y1:=y1-30; #80: y1:=y1+30; #75: x1:=x1-30; #77: x1:=x1+30 end; if x1<10 then x1:=10; if x1>580 then x1:=580; if y1<10 then y1:=10; if y1>400 then y1:=400; Cleardevice; Putimage(x1, y1, p^, 0); Until arrow=#27; {esc} dispose(p); closegraph; End. {Main}