1 \section{\class{wxImageList
}}\label{wximagelist
}
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
8 wxImageList is used principally in conjunction with
\helpref{wxTreeCtrl
}{wxtreectrl
} and
9 \rtfsp\helpref{wxListCtrl
}{wxlistctrl
} classes.
11 \wxheading{Derived from
}
13 \helpref{wxObject
}{wxobject
}
17 \helpref{wxTreeCtrl
}{wxtreectrl
},
\helpref{wxListCtrl
}{wxlistctrl
}
19 \latexignore{\rtfignore{\wxheading{Members
}}}
21 \membersection{wxImageList::wxImageList
}\label{wximagelistconstr
}
23 \func{}{wxImageList
}{\void}
27 \func{}{wxImageList
}{\param{int
}{width
},
\param{int
}{height
},
\param{const bool
}{mask = TRUE
},
\rtfsp
28 \param{int
}{initialCount =
1}}
30 Constructor specifying the image size, whether image masks should be created, and the initial size of the list.
32 \wxheading{Parameters
}
34 \docparam{width
}{Width of the images in the list.
}
36 \docparam{height
}{Height of the images in the list.
}
38 \docparam{mask
}{TRUE if masks should be created for all images.
}
40 \docparam{initialCount
}{The initial size of the list.
}
44 \helpref{wxImageList::Create
}{wximagelistcreate
}
46 \membersection{wxImageList::Add
}\label{wximagelistadd
}
48 \func{int
}{Add
}{\param{const wxBitmap\&
}{ bitmap
},
\param{const wxBitmap\&
}{ mask = wxNullBitmap
}}
50 Adds a new image using a bitmap and optional mask bitmap.
52 \func{int
}{Add
}{\param{const wxBitmap\&
}{ bitmap
},
\param{const wxColour\&
}{ maskColour
}}
54 Adds a new image using a bitmap and mask colour.
56 \func{int
}{Add
}{\param{const wxIcon\&
}{ icon
}}
58 Adds a new image using an icon.
60 \wxheading{Parameters
}
62 \docparam{bitmap
}{Bitmap representing the opaque areas of the image.
}
64 \docparam{mask
}{Monochrome mask bitmap, representing the transparent areas of the image.
}
66 \docparam{maskColour
}{Colour indicating which parts of the image are transparent.
}
68 \docparam{icon
}{Icon to use as the image.
}
70 \wxheading{Return value
}
72 The new zero-based image index.
76 The original bitmap or icon is not affected by the
{\bf Add
} operation, and can be deleted afterwards.
78 \membersection{wxImageList::Create
}\label{wximagelistcreate
}
80 \func{bool
}{Create
}{\param{int
}{width
},
\param{int
}{height
},
\param{const bool
}{mask = TRUE
},
\rtfsp
81 \param{int
}{initialCount =
1}}
83 Initializes the list. See
\helpref{wxImageList::wxImageList
}{wximagelistconstr
} for details.
85 \membersection{wxImageList::Draw
}\label{wximagelistdraw
}
87 \func{bool
}{Draw
}{\param{int
}{ index
},
\param{wxDC\&
}{ dc
},
\param{int
}{x
},
\rtfsp
88 \param{int
}{x
},
\param{int
}{flags = wxIMAGELIST
\_DRAW\_NORMAL},
\rtfsp
89 \param{const bool
}{solidBackground = FALSE
}}
91 Draws a specified image onto a device context.
93 \wxheading{Parameters
}
95 \docparam{index
}{Image index, starting from zero.
}
97 \docparam{dc
}{Device context to draw on.
}
99 \docparam{x
}{X position on the device context.
}
101 \docparam{y
}{Y position on the device context.
}
103 \docparam{flags
}{How to draw the image. A bitlist of a selection of the following:
105 \begin{twocollist
}\itemsep=
0pt
106 \twocolitem{{\bf wxIMAGELIST
\_DRAW\_NORMAL}}{Draw the image normally.
}
107 \twocolitem{{\bf wxIMAGELIST
\_DRAW\_TRANSPARENT}}{Draw the image with transparency.
}
108 \twocolitem{{\bf wxIMAGELIST
\_DRAW\_SELECTED}}{Draw the image in selected state.
}
109 \twocolitem{{\bf wxIMAGELIST
\_DRAW\_FOCUSED}}{Draw the image in a focussed state.
}
113 \docparam{solidBackground
}{For optimisation - drawing can be faster if the function is told
114 that the background is solid.
}
116 \membersection{wxImageList::GetImageCount
}\label{wximagelistgetimagecount
}
118 \constfunc{int
}{GetImageCount
}{\void}
120 Returns the number of images in the list.
122 \membersection{wxImageList::Remove
}\label{wximagelistremove
}
124 \func{bool
}{Remove
}{\param{int
}{ index
}}
126 Removes the image at the given position.
128 \membersection{wxImageList::RemoveAll
}\label{wximagelistremoveall
}
130 \func{bool
}{RemoveAll
}{\void}
132 Removes all the images in the list.
134 \membersection{wxImageList::Replace
}\label{wximagelistreplace
}
136 \func{bool
}{Replace
}{\param{int
}{ index
},
\param{const wxBitmap\&
}{ bitmap
},
\param{const wxBitmap\&
}{ mask = wxNullBitmap
}}
138 Replaces the existing image with the new image.
140 \func{bool
}{Replace
}{\param{int
}{ index
},
\param{const wxIcon\&
}{ icon
}}
142 Replaces the existing image with the new image.
144 \wxheading{Parameters
}
146 \docparam{bitmap
}{Bitmap representing the opaque areas of the image.
}
148 \docparam{mask
}{Monochrome mask bitmap, representing the transparent areas of the image.
}
150 \docparam{icon
}{Icon to use as the image.
}
152 \wxheading{Return value
}
154 TRUE if the replacement was successful, FALSE otherwise.
158 The original bitmap or icon is not affected by the
{\bf Replace
} operation, and can be deleted afterwards.