Зміст
End.
Else
End
Begin
Begin
Begin
End.
Begin
Begin
Repeat
Begin
Begin
Var
Const
End.
CloseGraph
Halt
Begin
Uses
Graph,Crt;
var GraphDriver,GraphMode:integer;
x0,y0:integer;
const path='c:\tp70\bgi';
GraphDriver:=detect;
InitGraph(GraphDriver,GraphMode,path);
if GraphResult <> GrOk then begin
writeln('GRAPHICESKIY REZIM NE USTANOVLEN ');
end;
SetBkColor(7);
SetColor(1);
x0:= GetMaxX div 2;
y0:= GetMaxY div 2;
Rectangle(x0-200,y0-100,x0+200,y0+100);
SetColor(Red);
Circle(x0,y0,150);
SetColor(Magenta);
SetTextStyle(GothicFont,HorizDir,3);
OutTextXY(x0-100,y0-10,'Das ist Fantactich');
SetColor(Cyan);
SetLineStyle(DottedLn,0,ThickWidth);
Line(x0-200,y0+100,x0+200,y0-100);
readln;
Здесь процедура
SetTextStyle( Font:word;Direction:word;CharSize:word) задаёт соответственно шрифт, направление и размер символов. Допускается нормальное (слева направо) и вертикальное (90 градусов к нормальному тексту, снизу вверх) направления. Размер любого шрифта может быть увеличен с помощью параметра CharSize. При CharSize равном 1 каждый символ 8*8 битового шрифта будет размещаться в квадрате 8*8 пикселей на экране, при CharSize равном 2 на экране воспроизведется тот же шрифт, но в квадрате 16*16 и т.д. Направление: HorizDir – 0, VertDir – 1; шрифты: DefaultFont – 0 (матричный шрифт), TriplexFont – 1, SmallFont – 2, SansSerifFont – 3, GothicFont – 4.
Процедура SetLineStyle (LineStyle:word;Pattern:word;Thickness:word); задаёт толщину и форму линии. Константы для этой процедуры:
SolidLn | Сплошная | |
DottedLn | Пунктирная | |
CenterLn | Штрих пунктирная | |
DachedLn | Штриховая | |
UserBitLn | Заданная пользователем | |
NormWidth | Тонкая | |
TickWidth | Толстая |
Пример программы графики с анимацией: катящееся колесо ударяется о тумбу и вызывает вращение другого колеса.
program cub;
uses graph,crt;
r=40; yo=350; x0:integer=500;
a=105; b=200; h=300;
graphdriver,graphmode,k: integer;
x1,dx,y,y1,x,dy,dy3: integer;
x4,x5,x6,x7,y4,y5,y6,y7,dy2: integer;
dx1,dy1,x2,y2,x3,y3,dx3,dx2: integer;
alfa,alf: real;
procedure line_spin(xo,i:integer;dalfa:real);
procedure picture(col:word);
setcolor(col);
line(x,y,x1,y1);
line(x2,y2,x3,y3);
line(x4,y4,x5,y5);
line(x6,y6,x7,y7);
line(a,b,a,h);
circle(xo,yo,r);
circle(a,b,r);
end;
x:=xo+r; x2:=xo;
|
|
|
|
|
|
|
x1:=xo-r; x3:=xo;
y1:=yo; y3:=yo-r;
alfa:=0;
dx:=round(r*cos(alfa));
dy:=round(r*sin(alfa));
dx1:=round(r*cos(alfa+pi/2));
dy1:=round(r*sin(alfa+pi/2));
picture(white);
delay(2000);
|
if k>144 then alf:=alf-dalfa;
|
dy2:=round(r*sin(alf));
dx3:=round(r*cos(alf+pi/2));
dy3:=round(r*sin(alf+pi/2));
x4:=a+dx2; x5:=a-dx2; x6:=a+dx3; x7:=a-dx3;
y4:=b-dy2; y5:=b+dy2; y6:=b-dy3; y7:=b+dy3;
if k<=144 then
xo:=xo-i;
x:=xo+dx; x1:=xo-dx; x2:=xo+dx1; x3:=xo-dx1;
y:=yo-dy; y1:=yo+dy; y2:=yo-dy1; y3:=yo+dy1;
end;
alfa:=alfa+dalfa;
k:=k+1;
until keypressed;
end;
graphdriver:=detect;
clrscr;
initgraph(graphdriver,graphmode,'c:\tp70\bgi');
setbkcolor(black);
rectangle(170,300,40,400);
line_spin(500,2,pi/72);
closegraph;
Пример программы графики в паскале с анимацией. Программа «Блок»
program ol;
uses Graph,crt;
var gd,gm,i,j:integer;
Gd:= detect;
InitGraph(gd, Gm, 'c:\tp70\bgi');
outtextxy(100,50,' State Academy of Oil and Gas');
outtextxy(100,70,' Group XH-94-1');
{ наклонная плоскость }
line(100,100,300,300);
line(300,300,100,300);
line(100,100,100,300);
setcolor(12);
{ блок }
circle(100,100,15);
line(85,100,85,220);
line(113,92,175+i,145+i);
bar(95,220,75,250);
setcolor(13);
line(161, 160, 201, 200);
line(196, 125, 236, 165);
line(161, 160, 196, 125);
line(201, 200, 236, 165);
{ движение маленького груза }
for j:=0 to 20 do
setcolor(10);
line(121+j, 120+j, 141+j, 140+j);
line(126+j, 115+j, 146+j, 135+j);
line(121+j, 120+j, 126+j, 115+j);
line(141+j, 140+j, 146+j, 135+j);
delay(30000);
setcolor(0);
line(121+j, 120+j, 141+j, 140+j);
line(126+j, 115+j, 146+j, 135+j);
line(121+j, 120+j, 126+j, 115+j);
line(141+j, 140+j, 146+j, 135+j);
end;
{ движение системы }
for i:=0 to 99 do
setcolor(i);
outtextxy(100,50,' State Academy of Oil and Gas');
outtextxy(100,70,' Group XH-94-1');
setcolor(13);
line(161+i, 160+i, 201+i, 200+i);
line(196+i, 125+i, 236+i, 165+i);
line(161+i, 160+i, 196+i, 125+i);
line(201+i, 200+I, 236+i, 165+i);
setcolor(10);
line(121+i+20, 120+i+20, 141+i+20, 140+i+20);
line(126+i+20, 115+i+20, 146+i+20, 135+i+20);
line(121+i+20, 120+i+20, 126+i+20, 115+i+20);
line(141+i+20, 140+i+20, 146+i+20, 135+i+20);
{ движение вертикальное }
setcolor(12);
setfillstyle(1,15);
bar(95,220-i,75,250-i);
line(85,100,85,220-i);
line(113,92,175+i,145+i);
delay(30000);
if i<99 then begin
setcolor(0);
setfillstyle(1,0);
bar(95,220-i,75,250-i);
line(121+i+20, 120+i+20, 141+i+20, 140+i+20);
line(126+i+20, 115+i+20, 146+i+20, 135+i+20);
line(121+i+20, 120+i+20, 126+i+20, 115+i+20);
line(141+i+20, 140+i+20, 146+i+20, 135+i+20);
line(161+i, 160+i, 201+i, 200+i);
line(196+i, 125+i, 236+i, 165+i);
line(161+i, 160+i, 196+i, 125+i);
line(201+i, 200+I, 236+i, 165+i);
line(85,100,85,220-i);
line(113,92,175+i,145+i);
end;
repeat until keypressed;
readln;
closegraph;
Тема 1. Мережеві операційні системи, ОС FreeBSD.. 2
Тема 2. Ядро ОС FreeBSD і управління програмним забезпеченням.. 29
Тема 3. Мережева підсистема FreeBSD.. 47
Тема 4. Маршрутизація трафіку в ОС FreeBSD.. 66
Тема 5. Динамічне налаштування мережевих інтерфейсів. 80
Тема 6. Засоби фільтрації трафіку. 91
Тема 7. Трансляція мережевих адрес. 106
Тема 8. Служба доменних імен. 116
Тема 9. Поштові служби. Протоколи SMTP, POP3. 135
Тема 10. Протокол IMAP. 153
Тема 11. Обмін файлами у мережах. Протокол FTP. 165
Тема 12. Обмін файлами у мережах. NFS, SMB, BitTorrent 180
Тема 13. Веб-сервер на основі ОС FreeBSD.. 195
Тема 14. Проксі –сервер. Сервіси моніторингу. 217
Тема 15. Захищені віртуальні канали. Стек протоколів IPSec. 234