X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e0cb07e37666cddac90e3e9fc52f7ed416ae69cd..b669780b33dc9af49b33d8b8ae1b399ad8c97ae5:/docs/latex/wx/image.tex diff --git a/docs/latex/wx/image.tex b/docs/latex/wx/image.tex index ab00bf5d0f..379ce7fb72 100644 --- a/docs/latex/wx/image.tex +++ b/docs/latex/wx/image.tex @@ -117,6 +117,10 @@ Loads an image from a file. Loads an image from an input stream. +\func{}{wxImage}{\param{const char** }{xpmData}} + +Creates an image from XPM data. + \wxheading{Parameters} \docparam{width}{Specifies the width of the image.} @@ -152,6 +156,8 @@ This is only used by GIF, ICO and TIFF handlers. The default value (-1) means "choose the default image" and is interpreted as the first image (index=0) by the GIF and TIFF handler and as the largest and most colourful one by the ICO handler.} +\docparam{xpmData}{A pointer to XPM image data.} + \wxheading{Remarks} Depending on how wxWidgets has been configured, not all formats may be available. @@ -539,6 +545,14 @@ Gets the green value of the mask colour. Gets the red value of the mask colour. +\membersection{wxImage::GetOrFindMaskColour}\label{wximagegetgetorsetmaskcolour} + +\constfunc{bool}{GetOrFindMaskColour}{\param{unsigned char}{ *r}, \param{unsigned char}{ *g}, \param{unsigned char}{ *b}} + +Get the current mask colour or find a suitable unused colour that could be +used as a mask colour. Returns {\tt true} if the image currently has a mask. + + \membersection{wxImage::GetPalette}\label{wximagegetpalette} \constfunc{const wxPalette\&}{GetPalette}{\void} @@ -619,6 +633,22 @@ If the given option is not present, the function returns $0$. Use \helpref{wxImage::HasOption}{wximagehasoption} is $0$ is a possibly valid value for the option. +Options for wxPNGHandler +\twocolwidtha{5cm}% +\begin{twocollist} +\twocolitem{wxIMAGE\_OPTION\_PNG\_FORMAT}{Format for saving a PNG file.} +\twocolitem{wxIMAGE\_OPTION\_PNG\_BITDEPTH}{Bit depth for every channel (R/G/B/A).} +\end{twocollist} + +Supported values for wxIMAGE\_OPTION\_PNG\_FORMAT: +\twocolwidtha{5cm}% +\begin{twocollist} +\twocolitem{wxPNG\_TYPE\_COLOUR}{Stores RGB image.} +\twocolitem{wxPNG\_TYPE\_GREY}{Stores grey image, converts from RGB.} +\twocolitem{wxPNG\_TYPE\_GREY\_RED}{Stores grey image, uses red value as grey.} +\end{twocollist} + + \wxheading{See also} \helpref{wxImage::SetOption}{wximagesetoption},\rtfsp @@ -809,8 +839,8 @@ Replaces the colour specified by {\it r1,g1,b1} by the colour {\it r2,g2,b2}. \func{wxImage \&}{Rescale}{\param{int}{ width}, \param{int}{ height}} -Changes the size of the image in-place: after a call to this function, the -image will have the given width and height. +Changes the size of the image in-place by scaling it: after a call to this function, +the image will have the given width and height. Returns the (modified) image itself. @@ -819,6 +849,24 @@ Returns the (modified) image itself. \helpref{Scale}{wximagescale} +\membersection{wxImage::Resize}\label{wximageresize} + +\func{wxImage \&}{Resize}{\param{const wxSize\&}{ size}, \param{const wxPoint&}{ pos}, \param{int}{ red = -1}, \param{int}{ green = -1}, \param{int}{ blue = -1}} + +Changes the size of the image in-place without scaling it by adding either a border +with the given colour or cropping as necessary. The image is pasted into a new +image with the given {\it size} and background colour at the position {\it pos} +relative to the upper left of the new image. If {\it red = green = blue = -1} +then use either the current mask colour if set or find, use, and set a +suitable mask colour for any newly exposed areas. + +Returns the (modified) image itself. + +\wxheading{See also} + +\helpref{Size}{wximagesize} + + \membersection{wxImage::Rotate}\label{wximagerotate} \func{wxImage}{Rotate}{\param{double}{ angle}, \param{const wxPoint\& }{rotationCentre}, @@ -957,6 +1005,22 @@ Example: \helpref{Rescale}{wximagerescale} +\membersection{wxImage::Size}\label{wximagesize} + +\constfunc{wxImage}{Size}{\param{const wxSize\&}{ size}, \param{const wxPoint&}{ pos}, \param{int}{ red = -1}, \param{int}{ green = -1}, \param{int}{ blue = -1}} + +Returns a resized version of this image without scaling it by adding either a border +with the given colour or cropping as necessary. The image is pasted into a new +image with the given {\it size} and background colour at the position {\it pos} +relative to the upper left of the new image. If {\it red = green = blue = -1} +then use either the current mask colour if set or find, use, and set a +suitable mask colour for any newly exposed areas. + +\wxheading{See also} + +\helpref{Resize}{wximageresize} + + \membersection{wxImage::SetAlpha}\label{wximagesetalpha} \func{void}{SetAlpha}{\param{unsigned char *}{alpha = {\tt NULL}}} @@ -1071,6 +1135,15 @@ be set directly. In that case you will have to get access to the image data using the \helpref{GetData}{wximagegetdata} method. +\membersection{wxImage::SetRGB}\label{wximagesetrgbrect} + +\func{void}{SetRGB}{\param{wxRect \& }{rect}, \param{unsigned char }{red}, \param{unsigned char }{green}, \param{unsigned char }{blue}} + +Sets the colour of the pixels within the given rectangle. This routine performs +bounds-checks for the coordinate so it can be considered a safe way to manipulate the +data. + + \membersection{wxImage::operator $=$}\label{wximageassign} \func{wxImage\& }{operator $=$}{\param{const wxImage\& }{image}}