]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/imaglist.tex
Added 'Include files' section to class references
[wxWidgets.git] / docs / latex / wx / imaglist.tex
1 \section{\class{wxImageList}}\label{wximagelist}
2
3 A wxImageList contains a list of images, which are stored in
4 an unspecified form. Images can have masks for transparent
5 drawing, and can be made from a variety of sources including bitmaps
6 and icons.
7
8 wxImageList is used principally in conjunction with \helpref{wxTreeCtrl}{wxtreectrl} and
9 \rtfsp\helpref{wxListCtrl}{wxlistctrl} classes.
10
11 \wxheading{Derived from}
12
13 \helpref{wxObject}{wxobject}
14
15 \wxheading{Include files}
16
17 <wx/imaglist.h>
18
19 \wxheading{See also}
20
21 \helpref{wxTreeCtrl}{wxtreectrl}, \helpref{wxListCtrl}{wxlistctrl}
22
23 \latexignore{\rtfignore{\wxheading{Members}}}
24
25 \membersection{wxImageList::wxImageList}\label{wximagelistconstr}
26
27 \func{}{wxImageList}{\void}
28
29 Default constructor.
30
31 \func{}{wxImageList}{\param{int }{width}, \param{int }{height}, \param{const bool }{mask = TRUE},\rtfsp
32 \param{int }{initialCount = 1}}
33
34 Constructor specifying the image size, whether image masks should be created, and the initial size of the list.
35
36 \wxheading{Parameters}
37
38 \docparam{width}{Width of the images in the list.}
39
40 \docparam{height}{Height of the images in the list.}
41
42 \docparam{mask}{TRUE if masks should be created for all images.}
43
44 \docparam{initialCount}{The initial size of the list.}
45
46 \wxheading{See also}
47
48 \helpref{wxImageList::Create}{wximagelistcreate}
49
50 \membersection{wxImageList::Add}\label{wximagelistadd}
51
52 \func{int}{Add}{\param{const wxBitmap\&}{ bitmap}, \param{const wxBitmap\&}{ mask = wxNullBitmap}}
53
54 Adds a new image using a bitmap and optional mask bitmap.
55
56 \func{int}{Add}{\param{const wxBitmap\&}{ bitmap}, \param{const wxColour\&}{ maskColour}}
57
58 Adds a new image using a bitmap and mask colour.
59
60 \func{int}{Add}{\param{const wxIcon\&}{ icon}}
61
62 Adds a new image using an icon.
63
64 \wxheading{Parameters}
65
66 \docparam{bitmap}{Bitmap representing the opaque areas of the image.}
67
68 \docparam{mask}{Monochrome mask bitmap, representing the transparent areas of the image.}
69
70 \docparam{maskColour}{Colour indicating which parts of the image are transparent.}
71
72 \docparam{icon}{Icon to use as the image.}
73
74 \wxheading{Return value}
75
76 The new zero-based image index.
77
78 \wxheading{Remarks}
79
80 The original bitmap or icon is not affected by the {\bf Add} operation, and can be deleted afterwards.
81
82 \membersection{wxImageList::Create}\label{wximagelistcreate}
83
84 \func{bool}{Create}{\param{int }{width}, \param{int }{height}, \param{const bool }{mask = TRUE},\rtfsp
85 \param{int }{initialCount = 1}}
86
87 Initializes the list. See \helpref{wxImageList::wxImageList}{wximagelistconstr} for details.
88
89 \membersection{wxImageList::Draw}\label{wximagelistdraw}
90
91 \func{bool}{Draw}{\param{int}{ index}, \param{wxDC\&}{ dc}, \param{int }{x},\rtfsp
92 \param{int }{x}, \param{int }{flags = wxIMAGELIST\_DRAW\_NORMAL},\rtfsp
93 \param{const bool }{solidBackground = FALSE}}
94
95 Draws a specified image onto a device context.
96
97 \wxheading{Parameters}
98
99 \docparam{index}{Image index, starting from zero.}
100
101 \docparam{dc}{Device context to draw on.}
102
103 \docparam{x}{X position on the device context.}
104
105 \docparam{y}{Y position on the device context.}
106
107 \docparam{flags}{How to draw the image. A bitlist of a selection of the following:
108
109 \begin{twocollist}\itemsep=0pt
110 \twocolitem{{\bf wxIMAGELIST\_DRAW\_NORMAL}}{Draw the image normally.}
111 \twocolitem{{\bf wxIMAGELIST\_DRAW\_TRANSPARENT}}{Draw the image with transparency.}
112 \twocolitem{{\bf wxIMAGELIST\_DRAW\_SELECTED}}{Draw the image in selected state.}
113 \twocolitem{{\bf wxIMAGELIST\_DRAW\_FOCUSED}}{Draw the image in a focussed state.}
114 \end{twocollist}
115 }
116
117 \docparam{solidBackground}{For optimisation - drawing can be faster if the function is told
118 that the background is solid.}
119
120 \membersection{wxImageList::GetImageCount}\label{wximagelistgetimagecount}
121
122 \constfunc{int}{GetImageCount}{\void}
123
124 Returns the number of images in the list.
125
126 \membersection{wxImageList::Remove}\label{wximagelistremove}
127
128 \func{bool}{Remove}{\param{int}{ index}}
129
130 Removes the image at the given position.
131
132 \membersection{wxImageList::RemoveAll}\label{wximagelistremoveall}
133
134 \func{bool}{RemoveAll}{\void}
135
136 Removes all the images in the list.
137
138 \membersection{wxImageList::Replace}\label{wximagelistreplace}
139
140 \func{bool}{Replace}{\param{int}{ index}, \param{const wxBitmap\&}{ bitmap}, \param{const wxBitmap\&}{ mask = wxNullBitmap}}
141
142 Replaces the existing image with the new image.
143
144 \func{bool}{Replace}{\param{int}{ index}, \param{const wxIcon\&}{ icon}}
145
146 Replaces the existing image with the new image.
147
148 \wxheading{Parameters}
149
150 \docparam{bitmap}{Bitmap representing the opaque areas of the image.}
151
152 \docparam{mask}{Monochrome mask bitmap, representing the transparent areas of the image.}
153
154 \docparam{icon}{Icon to use as the image.}
155
156 \wxheading{Return value}
157
158 TRUE if the replacement was successful, FALSE otherwise.
159
160 \wxheading{Remarks}
161
162 The original bitmap or icon is not affected by the {\bf Replace} operation, and can be deleted afterwards.
163
164