Documentation for Win32lib v0.60.6
Table of Contents

XPM

These routines deal with a portable graphics file format called XPM


XPM stands for "X Pixmap". XPM graphics can be embedded in programs as text data.

  • func createXpm( filename, euphoria bitmap )   Creates an XPM file from a Euphoria bitmap.
  • func createXpmFromBmpFile( filename, euphoria bitmap )   Creates an XPM file from a bitmap file.
  • proc setTransparentColor( object color )   Defines what the transparent color is to be.
  • func xpmToEuBmp( xpm )   Convert XPM data into a standard Euphoria bitmap.
  • func xpmToPixmap( xpm )    Create a Pixmap from XPM data.

    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    createXpm
    ( filename, euphoria bitmap )

    Creates an XPM file from a Euphoria bitmap.

    Returns: Status code.

    Category: XPM

    Status codes:

  • XPM_OK. File created successfully
  • XPM_ERR_FILE: File related error
  • XPM_ERR_COLORS: Too many colors in bitmap

    See Also: createXpmFromBmpFile, setTransparentColor, xpmToEuBmp, xpmToPixmap


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    createXpmFromBmpFile
    ( filename, euphoria bitmap )

    Creates an XPM file from a bitmap file.

    Returns: Status code.

    Category: XPM

    Status codes:

  • XPM_OK. File created successfully
  • XPM_ERR_FILE: File related error
  • XPM_ERR_COLORS: Too many colors in bitmap

    See Also: createXpm, setTransparentColor, xpmToEuBmp, xpmToPixmap


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    setTransparentColor
    ( object color )

    Defines what the transparent color is to be.

    Category: XPM

    The color can be an rgb atom, or a sequence in the form {r,g,b}.

    The default color is {255,0,255} (a light pink).

    For routines that create XPMs, this means that the color specified in the XPM as None are rendered using this color.

    The transBlt routine uses this value to determine what color not to render on the destination.

    This routine can also be used to make the transparent color of XPMs match the system color of buttons. This is useful for PictureButtons.

              -- set transparent colors to match button face color
               setTransparentColor( getSysColor( COLOR_BTNFACE ) )
    

    See Also: createXpm, createXpmFromBmpFile, xpmToEuBmp, xpmToPixmap


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    xpmToEuBmp
    ( xpm )

    Convert XPM data into a standard Euphoria bitmap.

    Returns: A Euphoria bitmap in a sequence. On failure, an error code.

    Category: XPM

    The error codes are:

  • XPM_ERR_COLORS: Too many colors in bitmap
  • XPM_ERR_HEADER: Error in XPM header
  • XPM_ERR_COLOR: Couldn't translate color code

    See Also: createXpm, createXpmFromBmpFile, setTransparentColor, xpmToPixmap


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    xpmToPixmap
    ( xpm )

    Create a Pixmap from XPM data.

    Returns: A Euphoria bitmap, or an error code.

    Category: XPM

    The error codes are:

  • XPM_ERR_COLORS: Too many colors in bitmap
  • XPM_ERR_HEADER: Error in XPM header
  • XPM_ERR_COLOR: Couldn't translate color code

    See Also: createXpm, createXpmFromBmpFile, setTransparentColor, xpmToEuBmp