📄 bitmap.tex
字号:
Finds the handler associated with the given bitmap type.\docparam{name}{The handler name.}\docparam{extension}{The file extension, such as ``bmp".}\docparam{bitmapType}{The bitmap type, such as wxBITMAP\_TYPE\_BMP.}\wxheading{Return value}A pointer to the handler if found, NULL otherwise.\wxheading{See also}\helpref{wxBitmapHandler}{wxbitmaphandler}\membersection{wxBitmap::GetDepth}\label{wxbitmapgetdepth}\constfunc{int}{GetDepth}{\void}Gets the colour depth of the bitmap. A value of 1 indicates amonochrome bitmap.\membersection{wxBitmap::GetHandlers}\label{wxbitmapgethandlers}\func{static wxList\&}{GetHandlers}{\void}Returns the static list of bitmap format handlers.\wxheading{See also}\helpref{wxBitmapHandler}{wxbitmaphandler}\membersection{wxBitmap::GetHeight}\label{wxbitmapgetheight}\constfunc{int}{GetHeight}{\void}Gets the height of the bitmap in pixels.\membersection{wxBitmap::GetPalette}\label{wxbitmapgetpalette}\constfunc{wxPalette*}{GetPalette}{\void}Gets the associated palette (if any) which may have been loaded from a fileor set for the bitmap.\wxheading{See also}\helpref{wxPalette}{wxpalette}\membersection{wxBitmap::GetMask}\label{wxbitmapgetmask}\constfunc{wxMask*}{GetMask}{\void}Gets the associated mask (if any) which may have been loaded from a fileor set for the bitmap.\wxheading{See also}\helpref{wxBitmap::SetMask}{wxbitmapsetmask}, \helpref{wxMask}{wxmask}\membersection{wxBitmap::GetWidth}\label{wxbitmapgetwidth}\constfunc{int}{GetWidth}{\void}Gets the width of the bitmap in pixels.\wxheading{See also}\helpref{wxBitmap::GetHeight}{wxbitmapgetheight}\membersection{wxBitmap::GetSubBitmap}\label{wxbitmapgetsubbitmap}\constfunc{wxBitmap}{GetSubBitmap}{\param{const wxRect\&}{rect}}Returns a sub bitmap of the current one as long as the rect belongs entirely tothe bitmap. This function preserves bit depth and mask information.\membersection{wxBitmap::InitStandardHandlers}\label{wxbitmapinitstandardhandlers}\func{static void}{InitStandardHandlers}{\void}Adds the standard bitmap format handlers, which, depending on wxWidgetsconfiguration, can be handlers for Windows bitmap, Windows bitmap resource, and XPM.This function is called by wxWidgets on startup.\wxheading{See also}\helpref{wxBitmapHandler}{wxbitmaphandler}\membersection{wxBitmap::InsertHandler}\label{wxbitmapinserthandler}\func{static void}{InsertHandler}{\param{wxBitmapHandler*}{ handler}}Adds a handler at the start of the static list of format handlers.\docparam{handler}{A new bitmap format handler object. There is usually only one instanceof a given handler class in an application session.}\wxheading{See also}\helpref{wxBitmapHandler}{wxbitmaphandler}\membersection{wxBitmap::LoadFile}\label{wxbitmaploadfile}\func{bool}{LoadFile}{\param{const wxString\&}{ name}, \param{wxBitmapType}{ type}}Loads a bitmap from a file or resource.\wxheading{Parameters}\docparam{name}{Either a filename or a Windows resource name.The meaning of {\it name} is determined by the {\it type} parameter.}\docparam{type}{One of the following values:\twocolwidtha{5cm}\begin{twocollist}\twocolitem{{\bf wxBITMAP\_TYPE\_BMP}}{Load a Windows bitmap file.}\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.}\end{twocollist}The validity of these flags depends on the platform and wxWidgets configuration.In addition, wxBitmap can read all formats that \helpref{wxImage}{wximage} can(wxBITMAP\_TYPE\_JPEG, wxBITMAP\_TYPE\_PNG, wxBITMAP\_TYPE\_GIF, wxBITMAP\_TYPE\_PCX, wxBITMAP\_TYPE\_PNM).(Of course you must have wxImage handlers loaded.) }\wxheading{Return value}true if the operation succeeded, false otherwise.\wxheading{Remarks}A palette may be associated with the bitmap if one exists (especially forcolour Windows bitmaps), and if the code supports it. You can checkif one has been created by using the \helpref{GetPalette}{wxbitmapgetpalette} member.\wxheading{See also}\helpref{wxBitmap::SaveFile}{wxbitmapsavefile}\membersection{wxBitmap::IsOk}\label{wxbitmapisok}\constfunc{bool}{IsOk}{\void}Returns true if bitmap data is present.\membersection{wxBitmap::RemoveHandler}\label{wxbitmapremovehandler}\func{static bool}{RemoveHandler}{\param{const wxString\& }{name}}Finds the handler with the given name, and removes it. The handleris not deleted.\docparam{name}{The handler name.}\wxheading{Return value}true if the handler was found and removed, false otherwise.\wxheading{See also}\helpref{wxBitmapHandler}{wxbitmaphandler}\membersection{wxBitmap::SaveFile}\label{wxbitmapsavefile}\func{bool}{SaveFile}{\param{const wxString\& }{name}, \param{wxBitmapType}{ type}, \param{wxPalette* }{palette = NULL}}Saves a bitmap in the named file.\wxheading{Parameters}\docparam{name}{A filename. The meaning of {\it name} is determined by the {\it type} parameter.}\docparam{type}{One of the following values:\twocolwidtha{5cm}\begin{twocollist}\twocolitem{{\bf wxBITMAP\_TYPE\_BMP}}{Save a Windows bitmap file.}\twocolitem{{\bf wxBITMAP\_TYPE\_GIF}}{Save a GIF bitmap file.}\twocolitem{{\bf wxBITMAP\_TYPE\_XBM}}{Save an X bitmap file.}\twocolitem{{\bf wxBITMAP\_TYPE\_XPM}}{Save an XPM bitmap file.}\end{twocollist}The validity of these flags depends on the platform and wxWidgets configuration.In addition, wxBitmap can save all formats that \helpref{wxImage}{wximage} can(wxBITMAP\_TYPE\_JPEG, wxBITMAP\_TYPE\_PNG).(Of course you must have wxImage handlers loaded.) }\docparam{palette}{An optional palette used for saving the bitmap.}% TODO: this parameter should%probably be eliminated; instead the app should set the palette before saving.\wxheading{Return value}true if the operation succeeded, false otherwise.\wxheading{Remarks}Depending on how wxWidgets has been configured, not all formats may be available.\wxheading{See also}\helpref{wxBitmap::LoadFile}{wxbitmaploadfile}\membersection{wxBitmap::SetDepth}\label{wxbitmapsetdepth}\func{void}{SetDepth}{\param{int }{depth}}Sets the depth member (does not affect the bitmap data).\wxheading{Parameters}\docparam{depth}{Bitmap depth.}\membersection{wxBitmap::SetHeight}\label{wxbitmapsetheight}\func{void}{SetHeight}{\param{int }{height}}Sets the height member (does not affect the bitmap data).\wxheading{Parameters}\docparam{height}{Bitmap height in pixels.}\membersection{wxBitmap::SetMask}\label{wxbitmapsetmask}\func{void}{SetMask}{\param{wxMask* }{mask}}Sets the mask for this bitmap.\wxheading{Remarks}The bitmap object owns the mask once this has been called.\wxheading{See also}\helpref{wxBitmap::GetMask}{wxbitmapgetmask}, \helpref{wxMask}{wxmask}%% VZ: this function is an implementation detail and shouldn't be documented%%\membersection{wxBitmap::SetOk}\label{wxbitmapsetok}%%%%\func{void}{SetOk}{\param{int }{isOk}}%%%%Sets the validity member (does not affect the bitmap data).%%%%\wxheading{Parameters}%%%%\docparam{isOk}{Validity flag.}\membersection{wxBitmap::SetPalette}\label{wxbitmapsetpalette}\func{void}{SetPalette}{\param{const wxPalette\& }{palette}}Sets the associated palette. (Not implemented under GTK+).\wxheading{Parameters}\docparam{palette}{The palette to set.}\wxheading{See also}\helpref{wxPalette}{wxpalette}\membersection{wxBitmap::SetWidth}\label{wxbitmapsetwidth}\func{void}{SetWidth}{\param{int }{width}}Sets the width member (does not affect the bitmap data).\wxheading{Parameters}\docparam{width}{Bitmap width in pixels.}\membersection{wxBitmap::operator $=$}\label{wxbitmapassign}\func{wxBitmap\& }{operator $=$}{\param{const wxBitmap\& }{bitmap}}Assignment operator, using \helpref{reference counting}{trefcount}.\wxheading{Parameters}\docparam{bitmap}{Bitmap to assign.}\wxheading{Return value}Returns 'this' object.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -