home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / dtx9202 / tricks / pascal / out_shad.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1992-01-09  |  1.6 KB  |  71 lines

  1. (* ------------------------------------------------------ *)
  2. (*                    OUT_SHAD.PAS                        *)
  3. (*      Outline und Shadow für Grafik-Schriften           *)
  4. (*       (c) 1992 Frank Schimmel & DMV-Verlag             *)
  5. (* ------------------------------------------------------ *)
  6. PROGRAM Outline_Shadow;
  7.  
  8. USES Dos, Crt, Graph;
  9.  
  10. VAR
  11.   f, d, m : INTEGER;
  12.   c       : CHAR;
  13.  
  14.   PROCEDURE Shadow(x, y, f : INTEGER; s : STRING);
  15.   CONST
  16.     i = 2;
  17.   VAR
  18.     c : WORD;
  19.   BEGIN
  20.     c := GetColor;
  21.     SetColor(f);
  22.     OutTextXY(x+i, y+i, s);
  23.     SetColor(c);
  24.     OutTextXY(x, y, s);
  25.   END;
  26.  
  27.   PROCEDURE OutLine(x, y : INTEGER; s : STRING);
  28.   CONST
  29.     i = 1;
  30.   VAR
  31.     c : WORD;
  32.   BEGIN
  33.     c:=getcolor;
  34.     OutTextXY(x-i, y, s);
  35.     OutTextXY(x-i, y-i, s);
  36.     OutTextXY(x, y-i, s);
  37.     OutTextXY(x+i, y-i, s);
  38.     OutTextXY(x+i, y, s);
  39.     OutTextXY(x+i, y+i, s);
  40.     OutTextXY(x, y+i, s);
  41.     OutTextXY(x-i, y+i, s);
  42.     SetColor(getbkcolor);
  43.     OutTextXY(x, y, s);
  44.     SetColor(c);
  45.   END;
  46.  
  47.   PROCEDURE Ausgabe(i : INTEGER);
  48.   BEGIN
  49.     OutLine(30, 10+i*80, 'Outline');
  50.     Shadow(260, 10+i*80, 4, 'Shadow');
  51.     OutTextXY(500, 10+i*80, 'Normal');
  52.   END;
  53.  
  54. BEGIN
  55.   D := Detect;
  56.     (* SET BGIPATH=<Pfad zum BGI-Verzeichnis> *)
  57.   InitGraph(D, M, GetEnv('BGIPATH'));
  58.   IF GraphResult <> grOk THEN Halt(1);
  59.   ClearDevice;
  60.   SetTextStyle(0, 0, 1);
  61.   Ausgabe(0);
  62.   FOR f := 1 TO 4 DO BEGIN
  63.     SetTextStyle(f, 0, 4);
  64.     Ausgabe(f);
  65.   END;
  66.   c := ReadKey;
  67.   CloseGraph;
  68. END.
  69. (* ------------------------------------------------------ *)
  70. (*              Ende von OUT_SHAD.PAS                     *)
  71.