bitmap.tex

来自「Wxpython Implemented on Windows CE, Sou」· TEX 代码 · 共 632 行 · 第 1/2 页

TEX
632
字号
\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 a
monochrome 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 file
or 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 file
or 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 to
the 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 wxWidgets
configuration, 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 instance
of 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 for
colour Windows bitmaps), and if the code supports it. You can check
if one has been created by using the \helpref{GetPalette}{wxbitmapgetpalette} member.

\wxheading{See also}

\helpref{wxBitmap::SaveFile}{wxbitmapsavefile}

\membersection{wxBitmap::Ok}\label{wxbitmapok}

\constfunc{bool}{Ok}{\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 handler
is 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. 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.

\wxheading{Parameters}

\docparam{bitmap}{Bitmap to assign.}

\wxheading{Return value}

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.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?