THE META-HTML LANGUAGE REFERENCE MANUAL

Code Profiling [TOC] Example Module

Section Intro: Image Module

Image Module

Synopsis:

    Functions which allow the creation of GIF images. You create an image with IMAGE::CREATE, and you can then draw lines, arcs, and points into the image. When you are done creating the image, you call IMAGE::RETRIEVE to get the GIF image in a binary variable.

    Finally, when you are totally done with the image, you call IMAGE::DELETE to make the image go away.

Commands:

<image::arc IMAGEVAR &key [X] [Y] [WIDTH] [HEIGHT] [START] [END] [COLOR] [FILL]Simple

    Draws a partial ellipse centered at the point specified by X and Y, with a width of WIDTH and height of HEIGHT.

    The arguments of START and END are given in degrees, and specify the starting and ending points on the curve.

    The following code draws a red circle with a radius of 50 pixels where the exact center of the circle appears at 100,100:

    <image::arc image x=100 y=100 width=50 height=50 start=0 end=360 color=FF0000>

<image::copy SRC-IMAGE DST-IMAGE &key [SRC-X] [SRC-Y] [DST-X] [DST-Y] [SRC-WIDTH] [SRC-HEIGHT] [DST-WIDTH] [DST-HEIGHT]Simple

    Copies bits from SRC-IMAGE to DST-IMAGE. Both images must exist. If a different width or height is specified for the destination, the image is resized to fit the specified values.

<image::create IMAGEVAR &key [WIDTH] [HEIGHT] [SRC]Simple

    Creates a new image with the specified width and height, and makes IMAGEVAR be a receptacle for that image.

    If you pass SRC=/WWW/DOCS/IMAGES/FOO.GIF, then FOO.GIF will be loaded into the image variable instead of an empty image.

<image::delete IMAGEVARSimple

    Reclaims any space that is currently being used by IMAGEVAR.

<image::fill IMAGEVAR &key [X] [Y] [COLOR] [BORDER]Simple

    Fill an area of the image in IMAGEVAR with the color specified by COLOR. The filling starts at the point specified by ( X, Y), and continues in all directions bounded by pixels which are not the same color as the color at ( X, Y), or, optionally, which are not the same color as the color specified by BORDER.

<image::get-pixel IMAGEVAR &key [X] [Y]Simple

    Returns the color of the pixel at X, Y in IMAGEVAR

<image::info IMAGEVARSimple

    Returns an alist representing information about the image in IMAGEVAR. The alist contains WIDTH, HEIGHT, TOTAL-COLORS, and COLORS. COLORS is an array of the color values which appear in the image.

<image::line IMAGEVAR &key [X1] [Y1] [X2] [Y2] [COLOR] [BRUSH]Simple

    Draw a line in IMAGEVAR from ( X1, Y1) to ( X2, Y2) in the color COLOR. BRUSH, if supplied, is another image created with image::create, that will be used as the brush to paint the line. In that case, the COLOR argument is ignored.

<image::rect IMAGEVAR &key [X1] [Y1] [X2] [Y2] [COLOR] [FILL]Simple

    Draw a rectangle with the border lines in the color COLOR and perhaps filled with the color FILL. The rectangle is drawn with the upper-left corner specified by ( X1 Y1) and the bottom-right corner specified by ( X2, Y2).

<image::set-pixel IMAGEVAR &key [X] [Y] [COLOR]Simple

    Set the pixel in IMAGEVAR at location X, Y to the color COLOR.

<image::text IMAGEVAR TEXT &key [X] [Y] [COLOR] [SIZE] [ALIGN] [REPORT]Simple

    Write text on the image in IMAGEVAR at position X, Y, in the color COLOR. ALIGN can be one of "right", "center", or "left", and defaults to "center". SIZE ranges frome 1 to 6 and defaults to 3.

    If REPORT=TRUE is specified, the text isn't drawn, but all of the information about the drawing is returned as an alist.

<image::transparent IMAGEVAR &key [COLOR]Simple

    Makes COLOR be the transparent one for this image.

<image::write IMAGEVAR FILENAMESimple

    Writes the contents of the image in IMAGEVAR to the file specified by FILENAME. Returns "true" if the image was successfully written.

Edit Section
Function Index
Variable Index


The META-HTML Reference Manual V2.0 Copyright © 1995, 1998, Brian J. Fox
Found a bug? Send mail to bug-manual@metahtml.org