⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 image.tex

📁 很牛的GUI源码wxWidgets-2.8.0.zip 可在多种平台下运行.
💻 TEX
📖 第 1 页 / 共 4 页
字号:
\membersection{wxImage::Create}\label{wximagecreate}\func{bool}{Create}{\param{int}{ width}, \param{int}{ height}, \param{bool}{ clear=true}}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}\docparam{width}{The width of the image in pixels.}\docparam{height}{The height of the image in pixels.}\wxheading{Return value}true if the call succeeded, false otherwise.\membersection{wxImage::Destroy}\label{wximagedestroy}\func{void}{Destroy}{\void}Destroys the image data.\membersection{wxImage::FindFirstUnusedColour}\label{wximagefindfirstunusedcolour}\func{bool}{FindFirstUnusedColour}{\param{unsigned char *}{ r}, \param{unsigned char *}{ g}, \param{unsigned char *}{ b}, \param{unsigned char}{ startR = 1}, \param{unsigned char}{ startG = 0}, \param{unsigned char}{ startB = 0}}\wxheading{Parameters}\docparam{r,g,b}{Pointers to variables to save the colour.}\docparam{startR,startG,startB}{Initial values of the colour. Returned colourwill have RGB values equal to or greater than these.}Finds the first colour that is never used in the image. The search begins atgiven initial colour and continues by increasing R, G and B components (in thisorder) by 1 until an unused colour is found or the colour space exhausted.\wxheading{Return value}Returns false if there is no unused colour left, true on success.\wxheading{Notes}Note that this method involves computing the histogram, which iscomputationally intensive operation.\membersection{wxImage::FindHandler}\label{wximagefindhandler}\func{static wxImageHandler*}{FindHandler}{\param{const wxString\& }{name}}Finds the handler with the given name.\func{static wxImageHandler*}{FindHandler}{\param{const wxString\& }{extension}, \param{long}{ imageType}}Finds the handler associated with the given extension and type.\func{static wxImageHandler*}{FindHandler}{\param{long }{imageType}}Finds the handler associated with the given image type.\func{static wxImageHandler*}{FindHandlerMime}{\param{const wxString\& }{mimetype}}Finds the handler associated with the given MIME type.\docparam{name}{The handler name.}\docparam{extension}{The file extension, such as ``bmp".}\docparam{imageType}{The image type, such as wxBITMAP\_TYPE\_BMP.}\docparam{mimetype}{MIME type.}\wxheading{Return value}A pointer to the handler if found, NULL otherwise.\wxheading{See also}\helpref{wxImageHandler}{wximagehandler}\membersection{wxImage::GetImageExtWildcard}\label{wximagegetimageextwildcard}\func{static wxString}{GetImageExtWildcard}{\void}Iterates all registered wxImageHandler objects, and returns a string containing file extension maskssuitable 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", ::wxGetCwd(), "", _("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}}Returns the alpha value for the given pixel. This function may only be calledfor the images with alpha channel, use \helpref{HasAlpha}{wximagehasalpha} tocheck for this.The returned value is the {\it opacity} of the image, i.e. the value of $0$corresponds to the transparent pixels while the value of $255$ -- to the opaqueones.\constfunc{unsigned char *}{GetAlpha}{\void}Returns pointer to the array storing the alpha values for this image. Thispointer is {\tt NULL} for the images without the alpha channel. If the imagedoes have it, this pointer may be used to directly manipulate the alpha valueswhich are stored as the \helpref{RGB}{wximagegetdata} ones.\membersection{wxImage::GetBlue}\label{wximagegetblue}\constfunc{unsigned char}{GetBlue}{\param{int}{ x}, \param{int}{ y}}Returns the blue intensity at the given coordinate.\membersection{wxImage::GetData}\label{wximagegetdata}\constfunc{unsigned char*}{GetData}{\void}Returns the image data as an array. This is most often used when doingdirect image manipulation. The return value points to an array ofcharacters in RGBRGBRGB$\ldots$ format in the top-to-bottom, left-to-rightorder, that is the first RGB triplet corresponds to the pixel first pixel ofthe first row, the second one --- to the second pixel of the first row and soon until the end of the first row, with second row following after it and soon.You should not delete the returned pointer nor pass it to\helpref{wxImage::SetData}{wximagesetdata}.\membersection{wxImage::GetGreen}\label{wximagegetgreen}\constfunc{unsigned char}{GetGreen}{\param{int}{ x}, \param{int}{ y}}Returns the green intensity at the given coordinate.\membersection{wxImage::GetImageCount}\label{wximagegetimagecount}\func{static int}{GetImageCount}{\param{const wxString\&}{ filename}, \param{long}{ type = wxBITMAP\_TYPE\_ANY}}\func{static int}{GetImageCount}{\param{wxInputStream\&}{ stream}, \param{long}{ type = wxBITMAP\_TYPE\_ANY}}If the image file contains more than one image and the image handler is capableof retrieving these individually, this function will return the number ofavailable images.\docparam{name}{Name of the file to query.}\docparam{stream}{Opened input stream with image data. Currently, the stream must support seeking.}\docparam{type}{May be one of the following:\twocolwidtha{5cm}%\begin{twocollist}\twocolitem{\indexit{wxBITMAP\_TYPE\_BMP}}{Load a Windows bitmap file.}\twocolitem{\indexit{wxBITMAP\_TYPE\_GIF}}{Load a GIF bitmap file.}\twocolitem{\indexit{wxBITMAP\_TYPE\_JPEG}}{Load a JPEG bitmap file.}\twocolitem{\indexit{wxBITMAP\_TYPE\_PNG}}{Load a PNG bitmap file.}\twocolitem{\indexit{wxBITMAP\_TYPE\_PCX}}{Load a PCX bitmap file.}\twocolitem{\indexit{wxBITMAP\_TYPE\_PNM}}{Load a PNM bitmap file.}\twocolitem{\indexit{wxBITMAP\_TYPE\_TIF}}{Load a TIFF bitmap file.}\twocolitem{\indexit{wxBITMAP\_TYPE\_XPM}}{Load a XPM bitmap file.}\twocolitem{\indexit{wxBITMAP\_TYPE\_ICO}}{Load a Windows icon file (ICO).}\twocolitem{\indexit{wxBITMAP\_TYPE\_CUR}}{Load a Windows cursor file (CUR).}\twocolitem{\indexit{wxBITMAP\_TYPE\_ANI}}{Load a Windows animated cursor file (ANI).}\twocolitem{\indexit{wxBITMAP\_TYPE\_ANY}}{Will try to autodetect the format.}\end{twocollist}}\wxheading{Return value}Number of available images. For most image handlers, this is 1 (exceptionsare TIFF and ICO formats).\membersection{wxImage::GetHandlers}\label{wximagegethandlers}\func{static wxList\&}{GetHandlers}{\void}Returns the static list of image format handlers.\wxheading{See also}\helpref{wxImageHandler}{wximagehandler}\membersection{wxImage::GetHeight}\label{wximagegetheight}\constfunc{int}{GetHeight}{\void}Gets the height of the image in pixels.\membersection{wxImage::GetMaskBlue}\label{wximagegetmaskblue}\constfunc{unsigned char}{GetMaskBlue}{\void}Gets the blue value of the mask colour.\membersection{wxImage::GetMaskGreen}\label{wximagegetmaskgreen}\constfunc{unsigned char}{GetMaskGreen}{\void}Gets the green value of the mask colour.\membersection{wxImage::GetMaskRed}\label{wximagegetmaskred}\constfunc{unsigned char}{GetMaskRed}{\void}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 beused as a mask colour. Returns {\tt true} if the image currently has a mask.\membersection{wxImage::GetPalette}\label{wximagegetpalette}\constfunc{const wxPalette\&}{GetPalette}{\void}Returns the palette associated with the image. Currently the palette is onlyused when converting to wxBitmap under Windows. Some of the wxImage handlershave been modified to set the palette if one exists in the image file (usually256 or less colour images in GIF or PNG format).\membersection{wxImage::GetRed}\label{wximagegetred}\constfunc{unsigned char}{GetRed}{\param{int}{ x}, \param{int}{ y}}Returns the red intensity at the given coordinate.\membersection{wxImage::GetSubImage}\label{wximagegetsubimage}\constfunc{wxImage}{GetSubImage}{\param{const wxRect\&}{ rect}}Returns a sub image of the current one as long as the rect belongs entirely tothe image.\membersection{wxImage::GetWidth}\label{wximagegetwidth}\constfunc{int}{GetWidth}{\void}Gets the width of the image in pixels.\wxheading{See also}\helpref{wxImage::GetHeight}{wximagegetheight}\membersection{HSVValue::HSVValue}\label{hsvvaluehsvvalue}\func{}{HSVValue}{\param{double }{h = 0.0}, \param{double }{s = 0.0}, \param{double }{v = 0.0}}Constructor for HSVValue, an object that contains values for hue, saturation and value whichrepresent the value of a color. It is used by \helpref{wxImage::HSVtoRGB}{wximagehsvtorgb}and \helpref{wxImage::RGBtoHSV}{wximagergbtohsv}, whichconverts between HSV color space and RGB color space.\pythonnote{use wxImage\_HSVValue in wxPython}\membersection{wxImage::HSVtoRGB}\label{wximagehsvtorgb}\func{wxImage::RGBValue}{HSVtoRGB}{\param{const HSVValue \& }{hsv}}Converts a color in HSV color space to RGB color space.\membersection{wxImage::HasAlpha}\label{wximagehasalpha}\constfunc{bool}{HasAlpha}{\void}Returns true if this image has alpha channel, false otherwise.\wxheading{See also}\helpref{GetAlpha}{wximagegetalpha}, \helpref{SetAlpha}{wximagesetalpha}\membersection{wxImage::HasMask}\label{wximagehasmask}\constfunc{bool}{HasMask}{\void}Returns true if there is a mask active, false otherwise.\membersection{wxImage::GetOption}\label{wximagegetoption}\constfunc{wxString}{GetOption}{\param{const wxString\&}{ name}}Gets a user-defined option. The function is case-insensitive to {\it name}.For example, when saving as a JPEG file, the option {\bf quality} isused, which is a number between 0 and 100 (0 is terrible, 100 is very good).\wxheading{See also}\helpref{wxImage::SetOption}{wximagesetoption},\rtfsp\helpref{wxImage::GetOptionInt}{wximagegetoptionint},\rtfsp\helpref{wxImage::HasOption}{wximagehasoption}\membersection{wxImage::GetOptionInt}\label{wximagegetoptionint}\constfunc{int}{GetOptionInt}{\param{const wxString\&}{ name}}Gets a user-defined option as an integer. The function is case-insensitive to {\it name}.If the given option is not present, the function returns $0$. Use\helpref{wxImage::HasOption}{wximagehasoption} is $0$ is a possibly valid valuefor 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\helpref{wxImage::GetOption}{wximagegetoption}\membersection{wxImage::HasOption}\label{wximagehasoption}\constfunc{bool}{HasOption}{\param{const wxString\&}{ name}}Returns true if the given option is present. The function is case-insensitive to {\it name}.

⌨️ 快捷键说明

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