home *** CD-ROM | disk | FTP | other *** search
- { draw image }
- Delay(PauseTime);
- { PutImage(X, Y, Saucer^, XORput); { erase image }
- MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1); { width/height }
- until KeyPressed;
- FreeMem(Saucer, size);
- WaitToGo;
- end; { PutImagePlay }
-
- procedure PolyPlay;
- { Draw random polygons with random fill styles on the screen }
- const
- MaxPts = 5;
- type
- PolygonType = array[1..MaxPts] of PointType;
- var
- Poly : PolygonType;
- I, Color : word;
- begin
- MainWindow('FillPoly demonstration');
- StatusLine('Esc aborts or press a key...');
- repeat
- Color := RandColor;
- SetFillStyle(Random(11)+1, Color);
- SetColor(Color);
- for I := 1 to MaxPts do
- with Poly[I] do
- begin
- X := Random(MaxX);
- Y := Random(MaxY);
- end;
- FillPoly(MaxPts, Poly);
- until KeyPressed;
- WaitToGo;
- end; { PolyPlay }
-
- procedure FillStylePlay;
- { Display all of the predefined fill styles available }
- var
- Style : word;
- Width : word;
- Height : word;
- X, Y : word;
- I, J : word;
- ViewInfo : ViewPortType;
-
- procedure DrawBox(X, Y : word);
- begin
- SetFillStyle(Style, MaxColor);
- with ViewInfo do
- Bar(X, Y, X+Width, Y+Height);
- Rectangle(X, Y, X+Width, Y+Height);
- OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
- Inc(Style);
- end; { DrawBox }
-
- begin
- MainWindow('Pre-defined fill styles');
- GetViewSettings(ViewInfo);
- with ViewInfo do
- begin
- Width := 2 * ((x2+1) div 13);
- Height := 2 * ((y2-10) div 10);
- end;
- X := Width div 2;
- Y := Height div 2;
- Style := 0;
- for J := 1 to 3 do
- begin
- for I := 1 to 4 do
- begin
- DrawBox(X, Y);
- Inc(X, (Width div 2) * 3);
- end;
- X := Width div 2;
- Inc(Y, (Height div 2) * 3);
- end;
- SetTextJustify(LeftText, TopText);
- WaitToGo;
- end; { FillStylePlay }
-
- procedure FillPatternPlay;
- { Display some user defined fill patterns }
- const
- Patterns : array[0..11] of FillPatternType = (
- ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü !BBäx !! !BBäx !BBäx " ""DDêp ""DDêp >