ВУЗ:
Составители:
Рубрика:
83
procedure
Draw(X,Y:Integer;
Graphic:TGraphic);
Ɉɫɭɳɟɫɬɜɥɹɟɬ ɩɪɨɪɢɫɨɜɤɭ ɝɪɚɮɢɱɟɫɤɨɝɨ ɨɛɴɟɤ-
ɬɚ Graphic ɬɚɤ, ɱɬɨɛɵ ɥɟɜɵɣ ɜɟɪɯɧɢɣ ɭɝɨɥ ɨɛɴ-
ɟɤɬɚ ɪɚɫɩɨɥɨɠɢɥɫɹ ɜ ɬɨɱɤɟ (X, Y)
procedure
DrawFocusRect (const
Rect:TRect);
ɉɪɨɪɢɫɨɜɵɜɚɟɬ ɩɪɹɦɨɭɝɨɥɶɧɢɤ ɫ ɩɨɦɨɳɶɸ ɨɩɟ-
ɪɚɰɢɢ XOR, ɩɨɷɬɨɦɭ ɩɨɜɬɨɪɧɚɹ ɩɪɨɪɢɫɨɜɤɚ
ɭɧɢɱɬɨɠɚɟɬ ɪɚɧɟɟ ɜɵɱɟɪɱɟɧɧɵɣ ɩɪɹɦɨɭɝɨɥɶ-
ɧɢɤ. ɂɫɩɨɥɶɡɭɟɬɫɹ ɜ ɨɫɧɨɜɧɨɦ ɞɥɹ ɩɪɨɪɢɫɨɜɤɢ
ɧɟɫɬɚɧɞɚɪɬɧɵɯ ɢɧɬɟɪɮɟɣɫɧɵɯ ɷɥɟɦɟɧɬɨɜ ɩɪɢ
ɩɨɥɭɱɟɧɢɢ ɢɦɢ ɮɨɤɭɫɚ ɜɜɨɞɚ ɢ ɩɪɢ ɩɨɬɟɪɟ ɟɝɨ
procedure Ellipse(XI, Yl,
X2, Y2: Integers;
ɑɟɪɬɢɬ ɷɥɥɢɩɫ ɜ ɨɯɜɚɬɵɜɚɸɳɟɦ ɩɪɹɦɨɭɝɨɥɶɧɢ-
ɤɟ (XI, Yl)–(X2, Y2). Ɂɚɩɨɥɧɹɟɬ ɜɧɭɬɪɟɧɧɟɟ
ɩɪɨɫɬɪɚɧɫɬɜɨ ɷɥɥɢɩɫɚ ɬɟɤɭɳɟɣ ɤɢɫɬɶɸ
procedure FillRect(const
Rect: TRect);
Ɂɚɩɨɥɧɹɟɬ ɬɟɤɭɳɟɣ ɤɢɫɬɶɸ ɩɪɹɦɨɭɝɨɥɶɧɭɸ ɨɛ-
ɥɚɫɬɶ Rect, ɜɤɥɸɱɚɹ ɟɟ ɥɟɜɭɸ ɢ ɜɟɪɯɧɸɸ ɝɪɚ-
ɧɢɰɵ, ɧɨ ɧɟ ɡɚɬɪɚɝɢɜɚɹ ɩɪɚɜɭɸ ɢ ɧɢɠɧɸɸ ɝɪɚ-
ɧɢɰɵ
procedure FloodFill(X,
Y: Integer; Color:
TColor; Fill Style:
TFillStyle);
ɉɪɨɢɡɜɨɞɢɬ ɡɚɥɢɜɤɭ ɤɚɧɜɵ ɬɟɤɭɳɟɣ ɤɢɫɬɶɸ.
Ɂɚɥɢɜɤɚ ɧɚɱɢɧɚɟɬɫɹ ɫ ɬɨɱɤɢ (X, Y) ɢ ɪɚɫɩɪɨ-
ɫɬɪɚɧɹɟɬɫɹ ɜɨɜɫɟ ɫɬɨɪɨɧɵ ɨɬ ɧɟɟ. ȿɫɥɢ
FillStyle=fsSurface, ɡɚɥɢɜɤɚ ɪɚɫɩɪɨɫɬɪɚɧɹɟɬɫɹ ɧɚ
ɜɫɟ ɫɨɫɟɞɧɢɟ ɬɨɱɤɢ ɫ ɰɜɟɬɨɦ Color. ȿɫɥɢ
FillStyle=fsBorder, ɧɚɨɛɨɪɨɬ, ɡɚɥɢɜɤɚ ɩɪɟɤɪɚɳɚ-
ɟɬɫɹ ɧɚ ɬɨɱɤɚɯ ɫ ɷɬɢɦ ɰɜɟɬɨɦ
procedure FrameRect
(const Rect: TRect);
Ɉɱɟɪɱɢɜɚɟɬ ɝɪɚɧɢɰɵ ɩɪɹɦɨɭɝɨɥɶɧɢɤɚ Rect ɬɟ-
ɤɭɳɟɣ ɤɢɫɬɶɸ ɬɨɥɳɢɧɨɣ ɜ 1 ɩɢɤɫɟɥɶ ɛɟɡ ɡɚɩɨɥ-
ɧɟɧɢɹ ɜɧɭɬɪɟɧɧɟɣ ɱɚɫɬɢ ɩɪɹɦɨɭɝɨɥɶɧɢɤɚ
procedure LineTo(X,
Y: Integer);
ɑɟɪɬɢɬ ɥɢɧɢɸ ɨɬ ɬɟɤɭɳɟɝɨ ɩɨɥɨɠɟɧɢɹ ɩɟɪɚ ɞɨ
ɬɨɱɤɢ (X,Y)
procedure Lock; Ȼɥɨɤɢɪɭɟɬ ɤɚɧɜɭ ɜ ɦɧɨɝɨɩɨɬɨɱɧɵɯ ɩɪɢɥɨɠɟɧɢ-
ɹɯ ɞɥɹ ɩɪɟɞɨɬɜɪɚɳɟɧɢɹ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɤɚɧɜɵ ɜ
ɞɪɭɝɢɯ ɩɨɬɨɤɚɯ ɤɨɦɚɧɞ
procedure MoveTo(X,Y:
Integer);
ɉɟɪɟɦɟɳɚɟɬ ɩɟɪɨ ɜ ɩɨɥɨɠɟɧɢɟ (X, Y) ɛɟɡ ɜɵ-
ɱɟɪɱɢɜɚɧɢɹ ɥɢɧɢɣ
procedure Pie(XI, Yl,
X2, Y2, X3, Y3, X4, Y4:
Longint);
Ɋɢɫɭɟɬ ɫɟɤɬɨɪ ɷɥɥɢɩɫɚ ɜ ɨɯɜɚɬɵɜɚɸɳɟɦ ɩɪɹɦɨ-
ɭɝɨɥɶɧɢɤɟ (XI, Yl) – (X2, Y2). ɇɚɱɚɥɨ ɞɭɝɢ ɥɟ-
ɠɢɬ ɧɚ ɩɟɪɟɫɟɱɟɧɢɢ ɷɥɥɢɩɫɚ ɢ ɥɭɱɚ, ɩɪɨɜɟɞɟɧ-
ɧɨɝɨ ɢɡ ɟɝɨ ɰɟɧɬɪɚ ɜ ɬɨɱɤɭ (X3, Y3), ɚ ɤɨɧɟɰ - ɧɚ
ɩɟɪɟɫɟɱɟɧɢɢ ɫ ɥɭɱɨɦ ɢɡ ɰɟɧɬɪɚ ɜ ɬɨɱɤɭ (X4,
Y4). Ⱦɭɝɚ ɱɟɪɬɢɬɫɹ ɩɪɨɬɢɜ ɱɚɫɨɜɨɣ ɫɬɪɟɥɤɢ.
ɇɚɱɚɥɨ ɢ ɤɨɧɟɰ ɞɭɝɢ ɫɨɟɞɢɧɹɸɬɫɹ ɩɪɹɦɵɦɢ
ɥɢɧɢɹɦɢ ɫ ɟɟ ɰɟɧɬɪɨɦ
procedure Ɉɫɭɳɟɫɬɜɥɹɟɬ ɩɪɨɪɢɫɨɜɤɭ ɝɪɚɮɢɱɟɫɤɨɝɨ ɨɛɴɟɤ- Draw(X,Y:Integer; ɬɚ Graphic ɬɚɤ, ɱɬɨɛɵ ɥɟɜɵɣ ɜɟɪɯɧɢɣ ɭɝɨɥ ɨɛɴ- Graphic:TGraphic); ɟɤɬɚ ɪɚɫɩɨɥɨɠɢɥɫɹ ɜ ɬɨɱɤɟ (X, Y) procedure ɉɪɨɪɢɫɨɜɵɜɚɟɬ ɩɪɹɦɨɭɝɨɥɶɧɢɤ ɫ ɩɨɦɨɳɶɸ ɨɩɟ- DrawFocusRect (const ɪɚɰɢɢ XOR, ɩɨɷɬɨɦɭ ɩɨɜɬɨɪɧɚɹ ɩɪɨɪɢɫɨɜɤɚ Rect:TRect); ɭɧɢɱɬɨɠɚɟɬ ɪɚɧɟɟ ɜɵɱɟɪɱɟɧɧɵɣ ɩɪɹɦɨɭɝɨɥɶ- ɧɢɤ. ɂɫɩɨɥɶɡɭɟɬɫɹ ɜ ɨɫɧɨɜɧɨɦ ɞɥɹ ɩɪɨɪɢɫɨɜɤɢ ɧɟɫɬɚɧɞɚɪɬɧɵɯ ɢɧɬɟɪɮɟɣɫɧɵɯ ɷɥɟɦɟɧɬɨɜ ɩɪɢ ɩɨɥɭɱɟɧɢɢ ɢɦɢ ɮɨɤɭɫɚ ɜɜɨɞɚ ɢ ɩɪɢ ɩɨɬɟɪɟ ɟɝɨ procedure Ellipse(XI, Yl, ɑɟɪɬɢɬ ɷɥɥɢɩɫ ɜ ɨɯɜɚɬɵɜɚɸɳɟɦ ɩɪɹɦɨɭɝɨɥɶɧɢ- X2, Y2: Integers; ɤɟ (XI, Yl)–(X2, Y2). Ɂɚɩɨɥɧɹɟɬ ɜɧɭɬɪɟɧɧɟɟ ɩɪɨɫɬɪɚɧɫɬɜɨ ɷɥɥɢɩɫɚ ɬɟɤɭɳɟɣ ɤɢɫɬɶɸ procedure FillRect(const Ɂɚɩɨɥɧɹɟɬ ɬɟɤɭɳɟɣ ɤɢɫɬɶɸ ɩɪɹɦɨɭɝɨɥɶɧɭɸ ɨɛ- Rect: TRect); ɥɚɫɬɶ Rect, ɜɤɥɸɱɚɹ ɟɟ ɥɟɜɭɸ ɢ ɜɟɪɯɧɸɸ ɝɪɚ- ɧɢɰɵ, ɧɨ ɧɟ ɡɚɬɪɚɝɢɜɚɹ ɩɪɚɜɭɸ ɢ ɧɢɠɧɸɸ ɝɪɚ- ɧɢɰɵ procedure FloodFill(X, ɉɪɨɢɡɜɨɞɢɬ ɡɚɥɢɜɤɭ ɤɚɧɜɵ ɬɟɤɭɳɟɣ ɤɢɫɬɶɸ. Y: Integer; Color: Ɂɚɥɢɜɤɚ ɧɚɱɢɧɚɟɬɫɹ ɫ ɬɨɱɤɢ (X, Y) ɢ ɪɚɫɩɪɨ- TColor; Fill Style: ɫɬɪɚɧɹɟɬɫɹ ɜɨɜɫɟ ɫɬɨɪɨɧɵ ɨɬ ɧɟɟ. ȿɫɥɢ TFillStyle); FillStyle=fsSurface, ɡɚɥɢɜɤɚ ɪɚɫɩɪɨɫɬɪɚɧɹɟɬɫɹ ɧɚ ɜɫɟ ɫɨɫɟɞɧɢɟ ɬɨɱɤɢ ɫ ɰɜɟɬɨɦ Color. ȿɫɥɢ FillStyle=fsBorder, ɧɚɨɛɨɪɨɬ, ɡɚɥɢɜɤɚ ɩɪɟɤɪɚɳɚ- ɟɬɫɹ ɧɚ ɬɨɱɤɚɯ ɫ ɷɬɢɦ ɰɜɟɬɨɦ procedure FrameRect Ɉɱɟɪɱɢɜɚɟɬ ɝɪɚɧɢɰɵ ɩɪɹɦɨɭɝɨɥɶɧɢɤɚ Rect ɬɟ- (const Rect: TRect); ɤɭɳɟɣ ɤɢɫɬɶɸ ɬɨɥɳɢɧɨɣ ɜ 1 ɩɢɤɫɟɥɶ ɛɟɡ ɡɚɩɨɥ- ɧɟɧɢɹ ɜɧɭɬɪɟɧɧɟɣ ɱɚɫɬɢ ɩɪɹɦɨɭɝɨɥɶɧɢɤɚ procedure LineTo(X, ɑɟɪɬɢɬ ɥɢɧɢɸ ɨɬ ɬɟɤɭɳɟɝɨ ɩɨɥɨɠɟɧɢɹ ɩɟɪɚ ɞɨ Y: Integer); ɬɨɱɤɢ (X,Y) procedure Lock; Ȼɥɨɤɢɪɭɟɬ ɤɚɧɜɭ ɜ ɦɧɨɝɨɩɨɬɨɱɧɵɯ ɩɪɢɥɨɠɟɧɢ- ɹɯ ɞɥɹ ɩɪɟɞɨɬɜɪɚɳɟɧɢɹ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɤɚɧɜɵ ɜ ɞɪɭɝɢɯ ɩɨɬɨɤɚɯ ɤɨɦɚɧɞ procedure MoveTo(X,Y: ɉɟɪɟɦɟɳɚɟɬ ɩɟɪɨ ɜ ɩɨɥɨɠɟɧɢɟ (X, Y) ɛɟɡ ɜɵ- Integer); ɱɟɪɱɢɜɚɧɢɹ ɥɢɧɢɣ procedure Pie(XI, Yl, Ɋɢɫɭɟɬ ɫɟɤɬɨɪ ɷɥɥɢɩɫɚ ɜ ɨɯɜɚɬɵɜɚɸɳɟɦ ɩɪɹɦɨ- X2, Y2, X3, Y3, X4, Y4: ɭɝɨɥɶɧɢɤɟ (XI, Yl) – (X2, Y2). ɇɚɱɚɥɨ ɞɭɝɢ ɥɟ- Longint); ɠɢɬ ɧɚ ɩɟɪɟɫɟɱɟɧɢɢ ɷɥɥɢɩɫɚ ɢ ɥɭɱɚ, ɩɪɨɜɟɞɟɧ- ɧɨɝɨ ɢɡ ɟɝɨ ɰɟɧɬɪɚ ɜ ɬɨɱɤɭ (X3, Y3), ɚ ɤɨɧɟɰ - ɧɚ ɩɟɪɟɫɟɱɟɧɢɢ ɫ ɥɭɱɨɦ ɢɡ ɰɟɧɬɪɚ ɜ ɬɨɱɤɭ (X4, Y4). Ⱦɭɝɚ ɱɟɪɬɢɬɫɹ ɩɪɨɬɢɜ ɱɚɫɨɜɨɣ ɫɬɪɟɥɤɢ. ɇɚɱɚɥɨ ɢ ɤɨɧɟɰ ɞɭɝɢ ɫɨɟɞɢɧɹɸɬɫɹ ɩɪɹɦɵɦɢ ɥɢɧɢɹɦɢ ɫ ɟɟ ɰɟɧɬɪɨɦ 83