X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/487659e0fa411e8c78959146192341691c4c6780..4d4f4290eaf2b60554ca3a0c53ffa8805012e155:/docs/latex/wx/image.tex diff --git a/docs/latex/wx/image.tex b/docs/latex/wx/image.tex index 83c2b73604..67321949b7 100644 --- a/docs/latex/wx/image.tex +++ b/docs/latex/wx/image.tex @@ -29,7 +29,7 @@ alpha value with \helpref{HasAlpha}{wximagehasalpha}. In fact, currently only images loaded from PNG files with transparency information will have alpha channel but support for it will be added to the other formats as well (as well as support for saving images with alpha channel which is not still implemented -neither). +either). \wxheading{Available image handlers} @@ -93,9 +93,10 @@ instead.) Constructs an image from a platform-dependent bitmap. This preserves mask information so that bitmaps and images can be converted back and forth without loss in that respect. -\func{}{wxImage}{\param{int}{ width}, \param{int}{ height}} +\func{}{wxImage}{\param{int}{ width}, \param{int}{ height}, \param{bool}{ clear=true}} -Creates an image with the given width and height. +Creates an image with the given width and height. If {\it clear} is true, the new image will be initialized to black. +Otherwise, the image data will be uninitialized. \func{}{wxImage}{\param{int}{ width}, \param{int}{ height}, \param{unsigned char*}{ data}, \param{bool}{ static\_data=false}} @@ -188,9 +189,13 @@ platform-dependent bitmap} \perlnote{Constructors supported by wxPerl are:\par \begin{itemize} \item{Wx::Image->new( bitmap )} +\item{Wx::Image->new( icon )} \item{Wx::Image->new( width, height )} -\item{Wx::Image->new( name, type )} -\item{Wx::Image->new( name, mimetype )} +\item{Wx::Image->new( width, height, data )} +\item{Wx::Image->new( file, type, index )} +\item{Wx::Image->new( file, mimetype, index )} +\item{Wx::Image->new( stream, type, index )} +\item{Wx::Image->new( stream, mimetype, index )} \end{itemize} } @@ -275,9 +280,10 @@ Returns an identical copy of the image. \membersection{wxImage::Create}\label{wximagecreate} -\func{bool}{Create}{\param{int}{ width}, \param{int}{ height}} +\func{bool}{Create}{\param{int}{ width}, \param{int}{ height}, \param{bool}{ clear=true}} -Creates a fresh image. +Creates a fresh image. If {\it clear} is true, the new image will be initialized to black. +Otherwise, the image data will be uninitialized. \wxheading{Parameters} @@ -353,6 +359,29 @@ A pointer to the handler if found, NULL otherwise. \helpref{wxImageHandler}{wximagehandler} +\membersection{wxImage::GetImageExtWildcard} + +\func{static wxString}{GetImageExtWildcard}{\void} + +Iterates all registered wxImageHandler objects, and returns a string containing file extension masks +suitable for passing to file open/save dialog boxes. + +\wxheading{Return value} + +The format of the returned string is "(*.ext1;*.ext2)|*.ext1;*.ext2". + +It is usually a good idea to prepend a description before passing the result to the dialog. + +Example: + +\begin{verbatim} + wxFileDialog FileDlg( this, "Choose Image", ::wxGetWorkingDirectory(), "", _("Image Files ") + wxImage::GetImageExtWildcard(), wxOPEN ); +\end{verbatim} + +\wxheading{See also} + +\helpref{wxImageHandler}{wximagehandler} + \membersection{wxImage::GetAlpha}\label{wximagegetalpha} \constfunc{unsigned char}{GetAlpha}{\param{int}{ x}, \param{int}{ y}} @@ -877,7 +906,7 @@ Sets the image data without performing checks. The data given must have the size (width*height*3) or results will be unexpected. Don't use this method if you aren't sure you know what you are doing. -The data must have been allocated with {\tt malloc()}, {\large \bf NOT} with +The data must have been allocated with {\tt malloc()}, {\large {\bf NOT}} with {\tt operator new}. After this call the pointer to the data is owned by the wxImage object,