ImageList Object

Object List Next Object

Definition:

An object containing several images, which can each be referred to by their index. The ImageList object is used by the TabStrip and ListView controls to specify the source for bitmap icons. The ImageList can be used standalone, since it has a Draw method that can render any of the images to a specific Device Context.

Specialized Features:

The following table lists and describes the properties and methods that are added by ImageList. There are no added events:


Property Use to...


Count Indicate how many images are contained in the list.

Himl Indicate the handle to the Windows ImageList.

ImageHeight Indicate the height of each image in the list.

ImageWidth Indicate the width of each image in the list.


Method Use to...


AddBitmaps Add images to the list from a Bitmap object, specifying a mask bitmap to use from the mask bitmap.

AddBitmapsMasked Add images to the list from a Bitmap object, specifying a mask color to use to create the mask bitmap.

AddBitmapScaled Add a single image to the ImageList which will be scaled to fit the existing dimesions of the ImageList.

AddIconResource Add an image to the list that exists as an Icon resource.

Draw Draws an image from the ImageList to the specified Device Context.

RemoveImage Remove the image at the specified index from the ImageList.

Copied Features:

None
this is a top-level object.

Details:

With the ImageList control you can load all bitmaps or all icons, or a mixture of both bitmaps and icons. The only restriction being that all images must be the same size. There are no specific restrictions on image size, however, the amount of available memory may limit the total number of images you can load. There have been some
appearance problems associated with 24bit bitmaps being added to an ImageList, so it is preferable to choose bitmaps with 256 or fewer colors.

Additionally, you can reference an ImageList object from multiple Windows 95 common controls to save on system resources. The controls you can reference include the ListView and TabStrip controls. You must associate a certain ImageList with the control by using the appropriate property, in order to use an ImageList with these common controls. You can do this for the ListView control, by setting the Icons and SmallIcons properties to ImageList controls. Set the ImageLisRef property for the TabStrip control.

See Also: TabStrip object, ListView object