back to gui
wxImageList
generated from ../src/mod_gui/misc/imagelst.cpp
A wxImageList contains a list of images, which are stored in an unspecified form.
Images can have masks for transparent drawing, and can be made from a variety of
sources including bitmaps and icons.
wxImageList is used principally in conjunction with wxTreeCtrl and
wxListCtrl classes.
Constants
Constructor
wxImageList
wxImageList()
wxImageList(Width,
Height,
Mask = true,
Count = 1)
| Name |
Type |
Default |
Description |
| Width |
Integer |
|
The width of the images in the list
|
| Height |
Integer |
|
The height of the images in the list.
|
| Mask |
Boolean |
true |
When true (default) a mask is created for each image.
|
| Count |
Integer |
1 |
The size of the list.
|
Constructs a new wxImageList object.
Properties
| Name |
Type |
Description |
imageCount  |
Integer |
Returns the number of the images.
|
Methods
add
add(Bitmap,
Mask) : Integer
| Name |
Type |
Default |
Description |
| Bitmap |
wxBitmap |
|
|
| Mask |
Integer |
|
|
add(Bitmap,
Colour) : Integer
add(Icon) : Integer
| Name |
Type |
Default |
Description |
| Icon |
wxIcon |
|
|
Adds a new image using a bitmap and an optional mask bitmap
or adds a new image using a bitmap and a mask colour
or adds a new image using an icon.
Returns the new zero-based index of the image.
create
create(Width,
Height,
Mask = true,
Count = 1)
| Name |
Type |
Default |
Description |
| Width |
Integer |
|
The width of the images in the list
|
| Height |
Integer |
|
The height of the images in the list.
|
| Mask |
Boolean |
true |
When true (default) a mask is created for each image.
|
| Count |
Integer |
1 |
The size of the list.
|
Creates an image list. Width and Height specify the size of the images
in the list (all the same). Mask specifies whether the images have masks or not.
Count is the initial number of images to reserve.
getSize
getSize(Index = 0) : Boolean
| Name |
Type |
Default |
Description |
| Index |
Integer |
0 |
The index parameter is ignored as all images in the list have the same size.
|
This method returns an array with 3 elements. The first element is a boolean
indicating success or failure. The second element contains the width and
the third element contains the height. Because an array is returned
you can use the multiple return value as such:
[rc, width, height] = imgList.getSize();
remove
remove(Index) : Boolean
| Name |
Type |
Default |
Description |
| Index |
Integer |
|
The index of the image.
|
Removes the image with the given index. Returns true on success.
removeAll
removeAll() : Boolean
Removes all images. Returns true on success.
replace
replace(Index,
Bitmap,
Mask) : Boolean
| Name |
Type |
Default |
Description |
| Index |
Integer |
|
The index of the image to replace.
|
| Bitmap |
wxBitmap |
|
The new bitmap.
|
| Mask |
wxBitmap |
|
Monochrome mask bitmap, representing the transparent areas of the image.
Windows only.
|
replace(Index,
Icon) : Boolean
| Name |
Type |
Default |
Description |
| Index |
Integer |
|
The index of the image to replace.
|
| Icon |
wxIcon |
|
Icon to use as image.
|
Replaces the image at the given index with a new image.