Top Documents Download Gallery Repository
Are you looking for a Software Engineer? Check Here

56xpm Module

The xpm module provides measures to write image data in XPM format and to parse a list of strings that is described in the format. To utilize it, import the xpm module using import function.

Below is an example to parse a list of strings described in XPM format.

import(xpm)
foo_xpm = @{
"13 13 2 2 0 0",
"   c #000000",
"#  c #ffffff",
"          #               ",
"          #               ",
"  # # # # # # # # # #     ",
"          #               ",
"          #     #         ",
"        # # # # # #       ",
"      #   #     #   #     ",
"    #     #   #       #   ",
"  #       #   #       #   ",
"  #       #   #       #   ",
"  #       # #         #   ",
"    # # #           #     ",
"                # #       ",
}
img = image(`rgba).xpmdata(foo_xpm)

56.1Extension to image Class

This module extends the image class with methods described here.

image#write@xpm
image#write@xpm(stream:stream:w):reduce
Writes a xpm image to a stream.

image#xpmdata
image#xpmdata(xpm[]:string):reduce
Read xpm data from a string list.


Copyright (C) 2011-2017 ypsitau