world.WindowCreateImage
Creates an image in a miniwindow
Prototype
long WindowCreateImage(BSTR WindowName, BSTR ImageId, long Row8, long Row7, long Row6, long Row5, long Row4, long Row3, long Row2, long Row1);
Description
This creates a small image (bitmap) by specifying the bit pattern for an 8 x 8 bit image. This is primarily intended for making patterns for use with WindowImageOp, described elsewhere. By designing suitable patterns you could make grass, waves, or other landscape effects for use in maps.
WindowName - the name of an existing miniwindow.
ImageId - the image id to store this image under.
Row1, Row2, Row3, Row4, Row5, Row6, Row7, Row8 - the bit pattern for each row
The easiest way of making your own pattern is to use Lua's tonumber function and work in binary. When doing that, each '1' represents a bit that is set (and is thus in the PenColour) and each '0' represents a bit that is clear (and is thus in the BrushColour).
For more information, see:
http://www.gammon.com.au/mushclient/mw_images.htm
Lua example
WindowCreateImage (win, "im2",
tonumber ("11001100", 2), -- row 8
tonumber ("11001100", 2), -- row 7
tonumber ("00110011", 2), -- row 6
tonumber ("00110011", 2), -- row 5
tonumber ("11001100", 2), -- row 4
tonumber ("11001100", 2), -- row 3
tonumber ("00110011", 2), -- row 2
tonumber ("00110011", 2)) -- row 1
Return value
eNoSuchWindow - no such miniwindow
eOK - completed OK
Related topic
See also
| Function | Description |
|---|---|
| WindowCreate | Creates a miniwindow |
| WindowDrawImage | Draws an image into a miniwindow |
| WindowImageInfo | Returns information about an image |
| WindowImageList | Lists all images installed into a miniwindow |
| WindowImageOp | Draws an ellipse, rectangle or round rectangle, filled with an image |
| WindowLoadImage | Loads an image into a miniwindow from a disk file |