long WindowDrawImage(BSTR WindowName, BSTR ImageId, long Left, long Top, long Right, long Bottom, short Mode, long SrcLeft, long SrcTop, long SrcRight, long SrcBottom);
View list of data type meanings
This copies an image to the miniwindow.
Note that changes to miniwindows will not become visible until the output window is redrawn. This happens when new (visible) lines arrive from the MUD, or if you call WindowShow, Repaint, or Redraw.
WindowName - the name of an existing miniwindow.
ImageId - an image id that you have loaded.
Left, Top, Right, Bottom - describes the rectangle to be drawn to.
Mode - the method of drawing the image:
1 - Copy without stretching to the destination position. The image is not clipped, so only the Left and Top parameters are used - the full image is copied to that position.
To copy less than the full image you would need to use the SrcLeft, SrcTop, SrcRight, SrcBottom parameters to specify a smaller part of the image.
2 - Stretch or shrink the image appropriately to fit into the rectangle: Left, Top, Right, Bottom.
3 - Copy without stretching to the position Left, Top. However this is a transparent copy, where the pixel at the left,top corner (pixel position 0,0) is considered the transparent colour. Any pixels that exactly match that colour are not copied. WARNING - do not choose black or white as the transparent colour as that throws out the calculations. Choose some other colour (eg. purple) - you won't see that colour anyway.
SrcLeft, SrcTop, SrcRight, SrcBottom - the source rectangle in the original image (use 0,0,0,0 to get the whole image). Negative numbers for the SrcRight and SrcBottom parameters represent an offset from the bottom or right edge.
The intention of allowing sub-images was so that you could make up a map by having lots of small images (eg. houses, trees, rocks). Now instead of having to load hundreds of tiny image files into memory, which would doubtless take a while to open all those files, you open a single, larger, file in which the various sub-images are "tiled". For example, you might allocate a 32 x 32 pixel square for each image. Now by selecting the appropriate tile you can copy the sub-image from the main image.
For more information, see:
To draw images which have alpha channels, see WindowDrawImageAlpha.
Note that if you draw a monchrome image, such as one set up by WindowCreateImage then the pen colour from the most recent drawing operation is used as the foreground colour, and the brush colour for the background colour. Thus you may want to draw a small rectangle (eg. 1 x 1 pixel) with WindowCircleOp to establish those colours first.
Note: Available in version 4.34 onwards.
WindowDrawImage (win, "im", 20, 20, 0, 0, 1) -- straight copy
WindowDrawImage (win, "im", 20, 20, -20, -20, 2) -- stretch
WindowDrawImage (win, "im", 20, 20, -20, -20, 3) -- transparent