[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
GetPic                   Copies Area Contents into Buffer

 GetPic(var Dest : <type>; X1,Y1,X2,Y2 : Integer);                    [XG/TP]

    Copies the contents of an area on screen into Dest (for future
    restoration). The size of Dest must be sufficient to hold the
    information.

            Dest    A variable of any type.

           X1,Y1    Screen coordinates (column, row); upper-left corner of
                    area in pixels.

           X2,Y2    Screen coordinates (column, row); lower-right corner
                    of area in pixels.

          Notes:    The following formulas can be used to calculate the
                    minimum size that Dest should be:

                        Width  := 1 + Abs(X2-X1);
                        Height := 1 + Abs(Y2-Y1);
                        Size   := 6 + ((Width+3) div 4) * Height * 2;
                                                    { for 320x200 mode }
                        Size   := 6 + ((Width+7) div 8) * Height;
                                                    { for 640x200 mode }

                    The extended graphics external declaration file
                    GRAPH.P must be included to use this procedure.

                    The video display must be in graphics mode before this
                    procedure is called.

  -------------------------------- Example ---------------------------------

           {$I GRAPH.P }

           var
             Temp : array[1..518] of Byte;

           begin
             GraphMode;                     { 320x200 mode }
             Circle(160,100,80,1);          { draw circle }
             FillShape(160,100,3,1);        { and fill }
             GetPic(Temp,80,48,111,79);     { save chunk }
             FillScreen(0);                 { clear screen }
             PutPic(Temp,80,79);            { put chunk }
             Readln;                        { pause }
             TextMode                       { text mode }
           end.

See Also: PutPic
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson