smjg.libs.sdwf.imagelist.ImageList Class Reference

The smjg.libs.sdwf.imagelist.ImageList class represents an image list. More...

List of all members.

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.


Detailed Description

The smjg.libs.sdwf.imagelist.ImageList class represents an 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.

Since:
0.56

Constructor & Destructor Documentation

smjg.libs.sdwf.imagelist.ImageList.this ( int  width,
int  height,
ILC  flags,
uint  len,
uint  capacity = 0 
)

Constructs a new ImageList.

Parameters:
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.
Status:
test further

smjg.libs.sdwf.imagelist.ImageList.this ( RectDim  dim,
ILC  flags,
int  len,
int  capacity = 0 
)

Constructs a new ImageList.

Parameters:
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.
Status:
test

smjg.libs.sdwf.imagelist.ImageList.~this (  ) 


Member Function Documentation

int smjg.libs.sdwf.imagelist.ImageList.add ( Bitmap  image  ) 

Adds images to the image list.

Parameters:
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.
Returns:
index assigned to the first added image.
Precondition:
this image list must be non-masked, i.e. created without the ILC.MASK flag.
Status:
test further

int smjg.libs.sdwf.imagelist.ImageList.add ( Bitmap  image,
Bitmap  mask 
)

Adds images to the image list.

Parameters:
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.
Returns:
index assigned to the first added image.
Precondition:
this image list must be masked, i.e. created with the ILC.MASK flag.
Status:
test further

int smjg.libs.sdwf.imagelist.ImageList.add ( Bitmap  image,
RGBColour  transparent 
)

Adds images to the image list.

Parameters:
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.
Returns:
index assigned to the first added image.
Precondition:
this image list must be masked, i.e. created with the ILC.MASK flag.
Status:
test

int smjg.libs.sdwf.imagelist.ImageList.add ( CursorOrIcon  image  ) 

Adds a cursor or icon image to the image lits.

Parameters:
image the cursor or icon to add.
Returns:
index assigned to the added image.
Status:
test

void smjg.libs.sdwf.imagelist.ImageList.replace ( int  index,
Bitmap  image 
)

Replaces an image in the image list.

Parameters:
index the index of the image to replace.
image the replacement image.
Precondition:
this image list must be non-masked, i.e. created without the ILC.MASK flag.
Status:
test

void smjg.libs.sdwf.imagelist.ImageList.replace ( int  index,
Bitmap  image,
Bitmap  mask 
)

Replaces an image in the image list.

Parameters:
index the index of the image to replace.
image the replacement image.
mask the mask of the replacement image.
Precondition:
this image list must be masked, i.e. created with the ILC.MASK flag.
Status:
test

void smjg.libs.sdwf.imagelist.ImageList.replace ( int  index,
CursorOrIcon  image 
)

Replaces an image in the image list.

Parameters:
image the cursor or icon to use as the replacement image.
Status:
test

void smjg.libs.sdwf.imagelist.ImageList.remove ( int  index  ) 

Removes an image from the image list.

Parameters:
index the zero-based index of the image to remove.
Status:
test

void smjg.libs.sdwf.imagelist.ImageList.removeAll (  ) 

Removes all images from the image list.

Status:
test

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.

Parameters:
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.
Status:
done

void smjg.libs.sdwf.imagelist.ImageList.draw ( int  index,
DC  dc,
Point  p,
ILD  style = ILD.NORMAL 
)

Draws an image from the image list.

Parameters:
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.
Status:
test

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.


The documentation for this class was generated from the following file:
Generated on Sun Jan 11 21:54:14 2009 for Stewart's D Windows Framework by  doxygen 1.5.4