X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/906c935a80b10d53cecf57f71ab5f3f4f1d529ec..d3fa4bc22e84e3ca4d88cc1772f2d414140a1017:/interface/wx/bitmap.h diff --git a/interface/wx/bitmap.h b/interface/wx/bitmap.h index cf62947f78..5b6e278644 100644 --- a/interface/wx/bitmap.h +++ b/interface/wx/bitmap.h @@ -165,7 +165,7 @@ public: 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 additionaly alpha channel). + for bitmaps with an additionally alpha channel). Note that many wxBitmap functions take a @e type parameter, which is a value of the ::wxBitmapType enumeration. @@ -584,6 +584,31 @@ public: */ virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); + /** + Loads a bitmap from the memory containing image data in PNG format. + + This helper function provides the simplest way to create a wxBitmap + from PNG image data. On most platforms, it's simply a wrapper around + wxImage loading functions and so requires the PNG image handler to be + registered by either calling wxInitAllImageHandlers() which also + registers all the other image formats or including the necessary + header: + @code + #include + @endcode + and calling + @code + wxImage::AddHandler(new wxPNGHandler); + @endcode + in your application startup code. + + However under OS X this function uses native image loading and so + doesn't require wxWidgets PNG support. + + @since 2.9.5 + */ + static wxBitmap NewFromPNGData(const void* data, size_t size); + /** Finds the handler with the given name, and removes it. The handler is not deleted. @@ -710,19 +735,11 @@ public: /** Constructs a mask from a monochrome bitmap. - - @beginWxPythonOnly - This is the default constructor for wxMask in wxPython. - @endWxPythonOnly */ wxMask(const wxBitmap& bitmap); /** Constructs a mask from a bitmap and a colour that indicates the background. - - @beginWxPythonOnly - wxPython has an alternate wxMask constructor matching this form called wxMaskColour. - @endWxPythonOnly */ wxMask(const wxBitmap& bitmap, const wxColour& colour); @@ -752,5 +769,13 @@ public: Constructs a mask from a bitmap and a colour that indicates the background. */ bool Create(const wxBitmap& bitmap, const wxColour& colour); + + /** + Returns the mask as a monochrome bitmap. + Currently this method is implemented in wxMSW, wxGTK and wxOSX. + + @since 2.9.5 + */ + wxBitmap GetBitmap() const; };