Struct native_windows_gui::ImageList [−][src]
pub struct ImageList { pub handle: HIMAGELIST, pub owned: bool, }
Expand description
An image list is a collection of images of the same size, each of which can be referred to by its index. Image lists are used in controls such as tabs container and tree view in order to add icon next to the items.
There are two kinds of image list in Winapi: masked. This is a wrapper over the masked type.
Image list and the method that use them in controls are behind the “image-list” feature.
Builder parameters:
size
: The size size of the images in the image list. Default(32, 32)
initial
: The initial size (in images) of the image list. Default5
grow
: The number of images by which the image list can grow when the system needs to make room for new images. Default5
use native_windows_gui as nwg; fn build_image_list(list: &mut nwg::ImageList) { nwg::ImageList::builder() .size((64, 64)) .initial(10) .grow(1) .build(list); }
Fields
handle: HIMAGELIST
owned: bool
Implementations
Sets the size of the image list. This clears all current image data.
Adds a new bitmap to the image list. Returns the index to the image. Panics if the bitmap was not initialized
Adds a bitmap directly from a filename. The image is resized to the image list size. Returns the index to the image or an error if the image could not be loaded
Adds a new icon to the image list. Returns the index to the image. Panics if the icon was not initialized
Adds a icon directly from a filename. The image is resized to the image list size. Returns the index to the image or an error if the image could not be loaded
Removes the image at the specified index
When an image is removed, the indexes of the remaining images are adjusted so that the image indexes always range from zero to one less than the number of images in the image list. For example, if you remove the image at index 0, then image 1 becomes image 0, image 2 becomes image 1, and so on.
Replaces an image in the image list. Panics if the bitmap was not initialized
Replaces an image in the image list by an icon. Panics if the icon was not initialized
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ImageList
impl UnwindSafe for ImageList