X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f510b7b2f386afe6c3705c2cdbc9208435984dac..dc484d491b15355285a89da275c58c2ef247d1f4:/docs/latex/wx/bitmap.tex diff --git a/docs/latex/wx/bitmap.tex b/docs/latex/wx/bitmap.tex index 19d751882e..db2d9f7ac3 100644 --- a/docs/latex/wx/bitmap.tex +++ b/docs/latex/wx/bitmap.tex @@ -3,14 +3,14 @@ %\overview{Overview}{wxbitmapoverview} % This class encapsulates the concept of a platform-dependent bitmap, -either monochrome or colour. +either monochrome or colour or colour with alpha channel support. \wxheading{Derived from} \helpref{wxGDIObject}{wxgdiobject}\\ \helpref{wxObject}{wxobject} -\wxheading{Include file} +\wxheading{Include files} @@ -38,9 +38,15 @@ Default constructor. \func{}{wxBitmap}{\param{const wxBitmap\& }{bitmap}} -Copy constructor. +Copy constructor, uses \helpref{reference counting}{trefcount}. +To make a real copy, you can use: -\func{}{wxBitmap}{\param{void*}{ data}, \param{int}{ type}, \param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}} +\begin{verbatim} + wxBitmap newBitmap = oldBitmap.GetSubBitmap( + wxRect(0, 0, oldBitmap.GetWidth(), oldBitmap.GetHeight())); +\end{verbatim} + +\func{}{wxBitmap}{\param{const void*}{ data}, \param{int}{ type}, \param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}} Creates a bitmap from the given data which is interpreted in platform-dependent manner. @@ -64,9 +70,10 @@ bitmaps from static data. 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. +colour setting. Beginning with version 2.5.4 of wxWidgets a depth of 32 including +an alpha channel is supported under MSW, Mac and GTK+. -\func{}{wxBitmap}{\param{const char**}{ bits}} +\func{}{wxBitmap}{\param{const char* const*}{ bits}} Creates a bitmap from XPM data. @@ -110,11 +117,11 @@ Its meaning is determined by the {\it type} parameter.} \twocolwidtha{5cm} \begin{twocollist} \twocolitem{\indexit{wxBITMAP\_TYPE\_BMP}}{Load a Windows bitmap file.} -\twocolitem{\indexit{wxBITMAP\_TYPE\_BMP\_RESOURCE}}{Load a Windows bitmap from the resource database.} +\twocolitem{\indexit{wxBITMAP\_TYPE\_BMP\_RESOURCE}}{Load a Windows bitmap resource from the executable. Windows only.} +\twocolitem{\indexit{wxBITMAP\_TYPE\_PICT\_RESOURCE}}{Load a PICT image resource from the executable. Mac OS only.} \twocolitem{\indexit{wxBITMAP\_TYPE\_GIF}}{Load a GIF bitmap file.} \twocolitem{\indexit{wxBITMAP\_TYPE\_XBM}}{Load an X bitmap file.} \twocolitem{\indexit{wxBITMAP\_TYPE\_XPM}}{Load an XPM bitmap file.} -\twocolitem{\indexit{wxBITMAP\_TYPE\_RESOURCE}}{Load a Windows resource name.} \end{twocollist} The validity of these flags depends on the platform and wxWidgets configuration. @@ -199,10 +206,8 @@ wxImage to a wxBitmap.} \func{}{\destruct{wxBitmap}}{\void} -Destroys the wxBitmap object and possibly the underlying bitmap data. -Because reference counting is used, the bitmap may not actually be -destroyed at this point - only when the reference count is zero will the -data be deleted. +Destructor. +See \helpref{reference-counted object destruction}{refcountdestruct} for more info. If the application omits to delete the bitmap explicitly, the bitmap will be destroyed automatically by wxWidgets when the application exits. @@ -251,7 +256,7 @@ Creates the bitmap from an icon. Creates a fresh bitmap. If the final argument is omitted, the display depth of the screen is used. -\func{virtual bool}{Create}{\param{void*}{ data}, \param{int}{ type}, \param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}} +\func{virtual bool}{Create}{\param{const 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. @@ -287,11 +292,11 @@ type of data. Finds the handler with the given name. -\func{static wxBitmapHandler*}{FindHandler}{\param{const wxString\& }{extension}, \param{long}{ bitmapType}} +\func{static wxBitmapHandler*}{FindHandler}{\param{const wxString\& }{extension}, \param{wxBitmapType}{ bitmapType}} Finds the handler associated with the given extension and type. -\func{static wxBitmapHandler*}{FindHandler}{\param{long }{bitmapType}} +\func{static wxBitmapHandler*}{FindHandler}{\param{wxBitmapType }{bitmapType}} Finds the handler associated with the given bitmap type. @@ -399,7 +404,7 @@ of a given handler class in an application session.} \membersection{wxBitmap::LoadFile}\label{wxbitmaploadfile} -\func{bool}{LoadFile}{\param{const wxString\&}{ name}, \param{long}{ type}} +\func{bool}{LoadFile}{\param{const wxString\&}{ name}, \param{wxBitmapType}{ type}} Loads a bitmap from a file or resource. @@ -413,7 +418,8 @@ The meaning of {\it name} is determined by the {\it type} parameter.} \twocolwidtha{5cm} \begin{twocollist} \twocolitem{{\bf wxBITMAP\_TYPE\_BMP}}{Load a Windows bitmap file.} -\twocolitem{{\bf wxBITMAP\_TYPE\_BMP\_RESOURCE}}{Load a Windows bitmap from the resource database.} +\twocolitem{{\bf wxBITMAP\_TYPE\_BMP\_RESOURCE}}{Load a Windows bitmap resource from the executable.} +\twocolitem{{\bf wxBITMAP\_TYPE\_PICT\_RESOURCE}}{Load a PICT image resource from the executable. Mac OS only.} \twocolitem{{\bf wxBITMAP\_TYPE\_GIF}}{Load a GIF bitmap file.} \twocolitem{{\bf wxBITMAP\_TYPE\_XBM}}{Load an X bitmap file.} \twocolitem{{\bf wxBITMAP\_TYPE\_XPM}}{Load an XPM bitmap file.} @@ -439,9 +445,9 @@ if one has been created by using the \helpref{GetPalette}{wxbitmapgetpalette} me \helpref{wxBitmap::SaveFile}{wxbitmapsavefile} -\membersection{wxBitmap::Ok}\label{wxbitmapok} +\membersection{wxBitmap::IsOk}\label{wxbitmapisok} -\constfunc{bool}{Ok}{\void} +\constfunc{bool}{IsOk}{\void} Returns true if bitmap data is present. @@ -464,7 +470,7 @@ true if the handler was found and removed, false otherwise. \membersection{wxBitmap::SaveFile}\label{wxbitmapsavefile} -\func{bool}{SaveFile}{\param{const wxString\& }{name}, \param{int}{ type}, \param{wxPalette* }{palette = NULL}} +\func{bool}{SaveFile}{\param{const wxString\& }{name}, \param{wxBitmapType}{ type}, \param{wxPalette* }{palette = NULL}} Saves a bitmap in the named file. @@ -553,7 +559,7 @@ The bitmap object owns the mask once this has been called. \func{void}{SetPalette}{\param{const wxPalette\& }{palette}} -Sets the associated palette. +Sets the associated palette. (Not implemented under GTK+). \wxheading{Parameters} @@ -577,9 +583,7 @@ Sets the width member (does not affect the bitmap data). \func{wxBitmap\& }{operator $=$}{\param{const wxBitmap\& }{bitmap}} -Assignment operator. This operator does not copy any data, but instead -passes a pointer to the data in {\it bitmap} and increments a reference -counter. It is a fast operation. +Assignment operator, using \helpref{reference counting}{trefcount}. \wxheading{Parameters} @@ -589,33 +593,4 @@ counter. It is a fast operation. Returns 'this' object. -\membersection{wxBitmap::operator $==$}\label{wxbitmapequal} - -\func{bool}{operator $==$}{\param{const wxBitmap\& }{bitmap}} - -Equality operator. This operator tests whether the internal data pointers are -equal (a fast test). - -\wxheading{Parameters} - -\docparam{bitmap}{Bitmap to compare with 'this'} - -\wxheading{Return value} - -Returns true if the bitmaps were effectively equal, false otherwise. - -\membersection{wxBitmap::operator $!=$}\label{wxbitmapnotequal} - -\func{bool}{operator $!=$}{\param{const wxBitmap\& }{bitmap}} - -Inequality operator. This operator tests whether the internal data pointers are -unequal (a fast test). - -\wxheading{Parameters} - -\docparam{bitmap}{Bitmap to compare with 'this'} - -\wxheading{Return value} - -Returns true if the bitmaps were unequal, false otherwise.