Public Member Functions | |
this (int width, int height, ILC flags, uint len, uint capacity=0) | |
Constructs a new ImageList. | |
this (RectDim dim, ILC flags, int len, int capacity=0) | |
Constructs a new ImageList. | |
int | add (Bitmap image) |
Adds images to the image list. | |
int | add (Bitmap image, Bitmap mask) |
Adds images to the image list. | |
int | add (Bitmap image, RGBColour transparent) |
Adds images to the image list. | |
int | add (CursorOrIcon image) |
Adds a cursor or icon image to the image lits. | |
void | replace (int index, Bitmap image) |
Replaces an image in the image list. | |
void | replace (int index, Bitmap image, Bitmap mask) |
Replaces an image in the image list. | |
void | replace (int index, CursorOrIcon image) |
Replaces an image in the image list. | |
void | remove (int index) |
Removes an image from the image list. | |
void | removeAll () |
Removes all images from the image list. | |
void | draw (int index, DC dc, int x, int y, ILD style=ILD.NORMAL) |
Draws an image from the image list. | |
void | draw (int index, DC dc, Point p, ILD style=ILD.NORMAL) |
Draws an image from the image list. | |
~this () | |
Properties | |
HANDLE | handle () |
The Windows handle of the image list. | |
uint | length () |
The number of images in this image list. |
An image list is a collection of bitmapped images of the same dimensions, and is used to display graphics in certain contexts. In particular, Windows tree-view controls, list-view controls and dialog box tabs (only the first of which is currently supported by SDWF) all rely on image lists in order to display graphics in them.
An image list has its own copy of every image that is added to it. The original images can therefore be discarded (and subsequently garbage-collected) after adding them to the image list, if they are not needed for any other purpose.
Image lists can be masked or non-masked. A masked image list enables the images to contain transparent areas. To add images to a masked image list, two bitmaps must be supplied: one containing the images themselves and one containing the masks. The mask bitmap is a monochrome bitmap in which bits with value 0 (black) correspond to opaque pixels and bits with value 1 (white) correspond to transparent pixels.
smjg.libs.sdwf.imagelist.ImageList.this | ( | int | width, | |
int | height, | |||
ILC | flags, | |||
uint | len, | |||
uint | capacity = 0 | |||
) |
Constructs a new ImageList.
width | the width of each image, in pixels. | |
height | the height of each image, in pixels. | |
flags | a combination of flags used to set the colour depth of the images and whether to use a mask. | |
len | the number of images for which the image list will allocate memory initially. | |
capacity | the maximum number of images that the image list will contain. If omitted or 0, it is taken to equal len . |
smjg.libs.sdwf.imagelist.ImageList.this | ( | RectDim | dim, | |
ILC | flags, | |||
int | len, | |||
int | capacity = 0 | |||
) |
Constructs a new ImageList.
dim | the pixel dimensions of each image. | |
flags | a combination of flags used to set the colour depth of the images and whether to use a mask. | |
len | the number of images for which the image list will allocate memory initially. | |
capacity | the maximum number of images that the image list will contain. If omitted or 0, it is taken to equal len . |
smjg.libs.sdwf.imagelist.ImageList.~this | ( | ) |
int smjg.libs.sdwf.imagelist.ImageList.add | ( | Bitmap | image | ) |
Adds images to the image list.
image | a bitmap containing the images to add. To add multiple images, they must be arranged side by side in the bitmap, without any gaps. |
int smjg.libs.sdwf.imagelist.ImageList.add | ( | Bitmap | image, | |
Bitmap | mask | |||
) |
Adds images to the image list.
image | a bitmap containing the images to add. To add multiple images, they must be arranged side by side in the bitmap, without any gaps. | |
mask | a monochrome bitmap containing the image masks. |
int smjg.libs.sdwf.imagelist.ImageList.add | ( | Bitmap | image, | |
RGBColour | transparent | |||
) |
Adds images to the image list.
image | a bitmap containing the images to add. To add multiple images, they must be arranged side by side in the bitmap, without any gaps. | |
transparent | which colour in image to convert to transparent. |
int smjg.libs.sdwf.imagelist.ImageList.add | ( | CursorOrIcon | image | ) |
Adds a cursor or icon image to the image lits.
image | the cursor or icon to add. |
void smjg.libs.sdwf.imagelist.ImageList.replace | ( | int | index, | |
Bitmap | image | |||
) |
Replaces an image in the image list.
index | the index of the image to replace. | |
image | the replacement image. |
void smjg.libs.sdwf.imagelist.ImageList.replace | ( | int | index, | |
Bitmap | image, | |||
Bitmap | mask | |||
) |
Replaces an image in the image list.
index | the index of the image to replace. | |
image | the replacement image. | |
mask | the mask of the replacement image. |
void smjg.libs.sdwf.imagelist.ImageList.replace | ( | int | index, | |
CursorOrIcon | image | |||
) |
Replaces an image in the image list.
image | the cursor or icon to use as the replacement image. |
void smjg.libs.sdwf.imagelist.ImageList.remove | ( | int | index | ) |
Removes an image from the image list.
index | the zero-based index of the image to remove. |
void smjg.libs.sdwf.imagelist.ImageList.removeAll | ( | ) |
void smjg.libs.sdwf.imagelist.ImageList.draw | ( | int | index, | |
DC | dc, | |||
int | x, | |||
int | y, | |||
ILD | style = ILD.NORMAL | |||
) |
Draws an image from the image list.
index | the zero-based index of the image to add. | |
dc | the device context on which to draw the image. | |
x | x-coordinate at which to draw the image. | |
y | y-coordinate at which to draw the image. | |
style | a bitwise combination of flags used to define how the image is drawn. |
void smjg.libs.sdwf.imagelist.ImageList.draw | ( | int | index, | |
DC | dc, | |||
Point | p, | |||
ILD | style = ILD.NORMAL | |||
) |
Draws an image from the image list.
index | the zero-based index of the image to add. | |
dc | the device context on which to draw the image. | |
p | point at which to draw the image. | |
style | a bitwise combination of flags used to define how the image is drawn. |
HANDLE smjg.libs.sdwf.imagelist.ImageList.handle | ( | ) |
The Windows handle of the image list.
uint smjg.libs.sdwf.imagelist.ImageList.length | ( | ) |
The number of images in this image list.