[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 GRECT()
 Draw a rectangle in graphic mode
------------------------------------------------------------------------------
 Syntax

     GRECT(<nXStart>, <nYStart>, <nXEnd>, <nYEnd>,
        [<nStyle>], [<nColor>], [<nMode>]) --> NIL

 Arguments

     <nXStart>, <nYStart>, <nXEnd> and <nYEnd> define the
     rectangle coordinates in pixels.

     <nStyle> defines the style of the rectangle using one of the
     constants listed in the table below:

     Style Mode Constants
     ------------------------------------------------------------------------
     Constant     Description
     ------------------------------------------------------------------------
     LLG_FILL     The rectangle is displayed first and then it is filled with
                  the color and mode specified below
     LLG_FRAME    Display of the rectangle is restricted to its contour in
                  the color and mode specified below
     ------------------------------------------------------------------------

     <nColor> is a numeric value that represents the display color.  If
     this parameter is missing, the last color specified in a call to a
     CA-Clipper graphic function is used.  The value range of values is
     limited to the number of colors available in the selected video mode.
     In 16-color modes, valid values are between 0 and 15.  In 256-color
     modes, valid values are between 0 and 255.

     <nMode> represents the display mode.  The following are valid
     <nMode> values:

     Display Mode Constants
     ------------------------------------------------------------------------
     Constant       Description
     ------------------------------------------------------------------------
     LLG_MODE_SET   Display in SET mode (ignores any pixels present under the
                    line displayed).  This is the most common display mode.
     LLG_MODE_AND   Display in AND mode (executes an AND on pixels present
                    under the line at display time and on the display color).
     LLG_MODE_OR    Display in OR mode (executes an OR on pixels present
                    under the line at display time and on the display color).
     LLG_MODE_XOR   Display in XOR mode (executes an XOR on pixels present
                    under the line at display time and on the display color).
                    See note.
     ------------------------------------------------------------------------

     Note:  This method allows you to move objects around on the screen
     without damaging the background.  To retrieve the initial background,
     just repeat the call for display in XOR mode.  If the display mode
     parameter is missing, the last mode specified in a call to a CA-Clipper
     graphic function is used.

 Returns

     GRECT() always returns NIL.

 Description

     GRECT() draws filled or empty rectangles on the screen.  This function
     can be used only if you have set the screen to a graphic mode using
     GMODE().  It respects the constraints defined by GSETCLIP().

 Examples

     .  This example shows how to display a rectangle in a region
        restricted by clipping:

        // Switch to graphic mode
        SET VIDEOMODE LLG_VIDEO_VGA_640_480_16)
        // Restrict the display region to one portion of the screen
        GSETCLIP(100,100,300,300)
        // Draw a filled rectangle that is partially clipped
        GRECT(120,120,350,350,LG_FILL,2,LLG_MODE_SET)
        QUIT                               // End of application

 Files   Library is LLIBG.LIB, header file is Llibg.ch.


See Also: GELLIPSE() GLINE() GPOLYGON() GWRITEAT() GBMPDISP()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson