[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Draw graphic text without background

     GWRITEAT(<nColStart>, <nLnStart>, <cString>, [<nColor>],
        [<nMode>], [<aFont>]) --> nWidth


     <nColStart> and <nLnStart> define graphic text coordinates in

     <cString>is a character value representing the character string to
     be displayed.

     <nColor>is a numeric value representing the display color.  If the
     parameter is missing, the last color specified in a call to a CA-Clipper
     graphic function is used.

     The 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> is a numeric value representing the display mode.  The
     following are valid <nMode> values.  They are all #defines in
     Llibg.ch.Display color

     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.
     LLG_MODE_NIL   Allows you to compute the width of the string without
                    displaying anything on the screen.  Be aware that .FNT
                    fonts are proportional, which means that an "m" and an
                    "i" do not use the same number of pixels.

     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.

     <aFont> is an optional font array pointer which was created with the
     GFNTLOAD("MyFont.FND") function:

     FUNCTION ShowOneFont (cString)
        LOCAL aFont
        // Load a specific font file into memory
        aFont := GFNTLOAD("MyFont.FND")
        // Display cString using the loaded font

           GWRITEAT(X , Y , cString, nColor, LLG_MODE_SET, aFont)
           // *Important*
           // You must erase the font if it is no longer used.
           RETURN   NIL


     GWRITEAT() returns the width of the written text in pixels.


     GWRITEAT() displays text in graphic mode without affecting the
     background.  It is important not to confuse the functions DEVOUT() and
     GWRITEAT().  Even when you are in graphic mode, you should continue to
     use DEVPOS(), DEVOUT(), and QOUT() for all "normal" displays.  The
     functions related to GETs, TBROWSE, etc. use both foreground and
     background colors, and text can only be displayed in areas whose size is
     a multiple of the selected font size.


     GWRITEAT() should be used for graphic enhancements, such as a window
     title within its frame (as you do not want to overwrite the window
     frame's borders), or to display information in graphic areas where you
     want to explicitly handle whether or not the background is erased before
     a new display, as in adding a title to a bitmap.

     Unlike DEVOUT(), this function receives graphic coordinates only.  This
     allows you to display text pixel by pixel.  Since GWRITEAT() works with
     pixel coordinates instead of row and column coordinates, you may need to
     properly calculate nX and nY.  This function can be used only if you
     have set the screen to a graphic mode using SET VIDEOMODE().

     This function respects the constraints defined by GSETCLIP().


     .  This example writes a see-through title on the frame of a 3-D

        // Switch to graphic mode
        // Display a 3D box of constant width 16x16x16x16
        DISPBOX(nTop, nLeft, nBottom, nRight, LLG_BOX_GRAY_SQUARE)
        // Write the alias name transparently in the 3D frame
        nTop  * GMODE()[LLG_MODE_FONT_ROW],;
        QUIT                            // End of application

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

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