]>
git.saurik.com Git - wxWidgets.git/blob - interface/imaglist.h
b360a9c751388122f07147d6aff31cbe138a5c5c
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxImageList class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 A wxImageList contains a list of images, which are stored in
14 an unspecified form. Images can have masks for transparent
15 drawing, and can be made from a variety of sources including bitmaps
18 wxImageList is used principally in conjunction with wxTreeCtrl and
25 wxTreeCtrl, wxListCtrl
27 class wxImageList
: public wxObject
32 Constructor specifying the image size, whether image masks should be created,
33 and the initial size of the list.
36 Width of the images in the list.
39 Height of the images in the list.
42 @true if masks should be created for all images.
45 The initial size of the list.
50 wxImageList(int width
, int height
, bool mask
= @
true,
51 int initialCount
= 1);
56 Adds a new image using an icon.
59 Bitmap representing the opaque areas of the image.
62 Monochrome mask bitmap, representing the transparent areas of the image.
65 Colour indicating which parts of the image are transparent.
68 Icon to use as the image.
70 @returns The new zero-based image index.
72 @remarks The original bitmap or icon is not affected by the Add
73 operation, and can be deleted afterwards.
75 int Add(const wxBitmap
& bitmap
,
76 const wxBitmap
& mask
= wxNullBitmap
);
77 int Add(const wxBitmap
& bitmap
, const wxColour
& maskColour
);
78 int Add(const wxIcon
& icon
);
82 Initializes the list. See wxImageList() for details.
84 bool Create(int width
, int height
, bool mask
= @
true,
85 int initialCount
= 1);
88 Draws a specified image onto a device context.
91 Image index, starting from zero.
94 Device context to draw on.
97 X position on the device context.
100 Y position on the device context.
103 How to draw the image. A bitlist of a selection of the following:
105 wxIMAGELIST_DRAW_NORMAL
108 Draw the image normally.
110 wxIMAGELIST_DRAW_TRANSPARENT
113 Draw the image with transparency.
115 wxIMAGELIST_DRAW_SELECTED
118 Draw the image in selected state.
120 wxIMAGELIST_DRAW_FOCUSED
123 Draw the image in a focused state.
125 @param solidBackground
126 For optimisation - drawing can be faster if the function is told
127 that the background is solid.
129 bool Draw(int index
, wxDC
& dc
, int x
, int y
,
130 int flags
= wxIMAGELIST_DRAW_NORMAL
,
131 bool solidBackground
= @
false);
134 Returns the bitmap corresponding to the given index.
136 wxBitmap
GetBitmap(int index
);
139 Returns the icon corresponding to the given index.
141 wxIcon
GetIcon(int index
);
144 Returns the number of images in the list.
149 Retrieves the size of the images in the list. Currently, the @e index
150 parameter is ignored as all images in the list have the same size.
153 currently unused, should be 0
156 receives the width of the images in the list
159 receives the height of the images in the list
161 @returns @true if the function succeeded, @false if it failed (for example,
162 if the image list was not yet initialized).
164 bool GetSize(int index
, int& width
, int & height
);
167 Removes the image at the given position.
169 bool Remove(int index
);
172 Removes all the images in the list.
178 Replaces the existing image with the new image.
181 Bitmap representing the opaque areas of the image.
184 Monochrome mask bitmap, representing the transparent areas of the image.
187 Icon to use as the image.
189 @returns @true if the replacement was successful, @false otherwise.
191 @remarks The original bitmap or icon is not affected by the Replace
192 operation, and can be deleted afterwards.
194 bool Replace(int index
, const wxBitmap
& bitmap
,
195 const wxBitmap
& mask
= wxNullBitmap
);
196 bool Replace(int index
, const wxIcon
& icon
);