[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  XPfastPCX()
  Display a EGA/VGA PCX file.. fast!
------------------------------------------------------------------------------

  Function:    XPfastPCX()

               This function was formerly part of the CLIPFPCX library,
               but is added to the Expand Library for convenience. This
               function read's a PCX file and display's it on the screen.
               This function uses Assembly written routines for the decoding
               and writing of the picture, the result is an extremely
               fast way of displaying PCX pictures. There are a few
               restrictions, however:

                    . Only EGA/VGA PCX files that conform to the following
                      format are supported (Whidth/Height/Colors):

                        - EGA 640x350x16 (mode 10h)
                        - VGA 640x480x16 (mode 12h)
                        - VGA 320x200x256 (mode 13h)

                      These are all full screen pictures, as generated for
                      example by a grab program, PCXGRAB for instance.

                    . Only PCX files smaller than 64Kb can be displayed.

               The conclusion is that this function is typically useful
               for the display of Logo's or other full screen pictures.

               The amount of memory required is small.

               For real graphic applications, use an appropriate Library,
               but for displaying of Logo's or other fun with PCX files,
               this function is perfect. Moreover, it's extremely fast,
               I've never seen a program displaying a PCX picture faster than
               this one, thanks to the restrictions and use of Assembly.

  Syntax:      XPfastPCX(cFilename) --> nCode

  Arguments:   cFileName is the name of the file to display. The
               extension must be submitted by the programmer.

  Returns:     a Code indicating the result:

                    0   Displayed OK. Screen is still in graph mode.
                        restore with XPvmode() or XPsetmode().
                    1   File not Found. Don't forget to include .PCX!
                    2   The submitted file is not a PCX file?
                    3   The file has an unsupported format. Check with
                        a PCX header dump (PCXHDR.EXE for instance) if
                        the submitted file has the proper format.
                    4   The PCX file is too big. Only files .64Kb
                        can be displayed.
                    5   You do not have the required hardware (EGA always
                        and VGA in quite some cases).

               When the function returns 0, the PCX picture is still on the
               screen, to restore to the Text mode, use XPvmode() (see example
               below), after a Key-press for instance..

               If the Screen is in the correct video mode when calling
               the function, the video mode is not reset; this makes it
               possible to generate nice sliding effects with multiple
               PCX files of the same format.

               One should SET CURSOR ON before calling the Function, and
               restore the Cursor once the text Mode is reset using the
               XPvmode() function.

               If run on a VGA, one should call the VGAstdPal() function
               after the XPvmode() function. This restores the normal
               palette, as this has possibly been changed by the PCX
               picture. Future enhancements may include the possibility
               to Save the current VGA palette, and restore it later.

  Usage:       /* Put Logo with same name as Applic */
               nMode := XPvmode()     // Save Video mode
               XPfastPCX(Left(XPmyName(),Len(XPmyName())-3)+'PCX')
               XPmouseKey()           // Wait for Click or Key-Press
               XPvmode(nMode)         // Restore V mode

               See XPDEMO.EXE for a demonstration of its use.

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