![]() It differs from the above function only in what argument(s) it accepts. This is an overloaded member function, provided for convenience. WxBitmap (const wxSize &sz, int depth= wxBITMAP_SCREEN_DEPTH) WxBitmap (int width, int height, int depth= wxBITMAP_SCREEN_DEPTH) WxBitmap (const char bits, int width, int height, int depth=1)Ĭreates a bitmap from the given array bits. Predefined objects/pointers: wxNullBitmap See also Bitmaps and Icons, Supported Bitmap File Formats, wxDC::Blit, wxIcon, wxCursor, wxMemoryDC, wxImage, wxPixelDataĬopy constructor, uses reference counting. By splitting the responsibilities between wxImage/wxBitmap like this then it's easier to use generic code shared by all platforms and image types for generic operations and platform specific code where performance or compatibility is needed.Ĭategory: Graphics Device Interface (GDI) OTOH, wxBitmap is intended to be a wrapper of whatever is the native image format that is quickest/easiest to draw to a DC or to be the target of the drawing operations performed on a wxMemoryDC. It includes generic code for scaling, resizing, clipping, and other manipulations of the image data. It is all generic, platform independent and image file format independent code. More on the difference between wxImage and wxBitmap: wxImage is just a buffer of RGB bytes with an optional buffer for the alpha bytes. Note that all available wxBitmapHandlers for a given wxWidgets port are automatically loaded at startup so you won't need to use wxBitmap::AddHandler. Of course, you must have loaded the wxImage handlers (see wxInitAllImageHandlers() and wxImage::AddHandler). In addition, wxBitmap can load and save all formats that wxImage can see wxImage for more info. wxX11 supports XPM files, XPM data, XBM data.wxGTK supports any file supported by gdk-pixbuf.wxMSW supports BMP and ICO files, BMP and ICO resources.If all possible wxWidgets settings are used: ![]() ![]() The validity of those values depends however on the platform where your program is running and from the wxWidgets configuration. Note that many wxBitmap functions take a type parameter, which is a value of the wxBitmapType enumeration. If you need direct access the bitmap data instead going through drawing to it using wxMemoryDC you need to use the wxPixelData class (either wxNativePixelData for RGB bitmaps or wxAlphaPixelData for bitmaps with an additionally alpha channel). This class encapsulates the concept of a platform-dependent bitmap, either monochrome or colour or colour with alpha channel support.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |