X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f9ee644eac14adc5fcdf522f2483f13ebe66c9dd..5d9dba5b1a3a9072b8f9a2789ab39e11f193940d:/docs/latex/wx/bitmap.tex diff --git a/docs/latex/wx/bitmap.tex b/docs/latex/wx/bitmap.tex index 8150715c47..0fffc0a71a 100644 --- a/docs/latex/wx/bitmap.tex +++ b/docs/latex/wx/bitmap.tex @@ -42,22 +42,29 @@ Copy constructor. \func{}{wxBitmap}{\param{void*}{ data}, \param{int}{ type}, \param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}} -Creates a bitmap from the given data, which can be of arbitrary type. -Windows only, I think. +Creates a bitmap from the given data which is interpreted in platform-dependent +manner. \func{}{wxBitmap}{\param{const char}{ bits[]}, \param{int}{ width}, \param{int}{ height}\\ \param{int}{ depth = 1}} Creates a bitmap from an array of bits. -Note that the bit depth is ignored on GTK+ and Motif. If you want to create a bitmap -from something else than a 1-bit data array, use the \helpref{wxImage}{wximage} class. +You should only use this function for monochrome bitmaps ({\it depth} 1) in +portable programs: in this case the {\it bits} parameter should contain an XBM +image. + +For other bit depths, the behaviour is platform dependent: under Windows, the +data is passed withotu any changes to the underlying {\tt CreateBitmap()} API. +Under other platforms, only monochrome bitmaps may be created using this +constructor and \helpref{wxImage}{wximage} should be used for creating colour +bitmaps from static data. \func{}{wxBitmap}{\param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}} -Creates a new bitmap. A depth of -1 indicates the depth of the current screen or -visual. Some platforms only support 1 for monochrome and -1 for the current colour -setting. +Creates a new bitmap. A depth of -1 indicates the depth of the current screen +or visual. Some platforms only support 1 for monochrome and -1 for the current +colour setting. \func{}{wxBitmap}{\param{const char**}{ bits}} @@ -146,13 +153,13 @@ Under X, {\it type} defaults to wxBITMAP\_TYPE\_XPM. \pythonnote{Constructors supported by wxPython are:\par \indented{2cm}{\begin{twocollist} -\twocolitem{\bf{wxBitmap(name, flag)}}{Loads a bitmap from a file} -\twocolitem{\bf{wxBitmapFromData(data, type, width, height, depth=1)}}{Creates +\twocolitem{{\bf wxBitmap(name, flag)}}{Loads a bitmap from a file} +\twocolitem{{\bf wxBitmapFromData(data, type, width, height, depth=1)}}{Creates a bitmap from the given data, which can be of arbitrary type.} -\twocolitem{\bf{wxNoRefBitmap(name, flag)}}{This one won't own the +\twocolitem{{\bf wxNoRefBitmap(name, flag)}}{This one won't own the reference, so Python won't call the destructor, this is good for toolbars and such where the parent will manage the bitmap.} -\twocolitem{\bf{wxEmptyBitmap(width, height, depth = -1)}}{Creates an +\twocolitem{{\bf wxEmptyBitmap(width, height, depth = -1)}}{Creates an empty bitmap with the given specifications} \end{twocollist}} } @@ -314,7 +321,7 @@ Gets the width of the bitmap in pixels. \membersection{wxBitmap::GetSubBitmap}\label{wxbitmapgetsubbitmap} -\constfunc{wxBitmap}{GetSubBitmap}{\param{const wxRect&}{rect}} +\constfunc{wxBitmap}{GetSubBitmap}{\param{const wxRect\&}{rect}} Returns a sub bitmap of the current one as long as the rect belongs entirely to the bitmap. This function preserves bit depth and mask information.