X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4bea628d007cc8add79e6dee2863c7bdc1bccce5..8e77fd8bca165aab9709649d79a7cbc6a172d4e1:/include/wx/osx/bitmap.h diff --git a/include/wx/osx/bitmap.h b/include/wx/osx/bitmap.h index 61420faaec..d9ec58f7bf 100644 --- a/include/wx/osx/bitmap.h +++ b/include/wx/osx/bitmap.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: bitmap.h +// Name: wx/osx/bitmap.h // Purpose: wxBitmap class // Author: Stefan Csomor // Modified by: @@ -57,6 +57,8 @@ public: bool Create(const wxBitmap& bitmap); bool Create(const wxMemoryBuffer& buf, int width , int height , int bytesPerRow ) ; + wxBitmap GetBitmap() const; + // Implementation below void Init() ; @@ -100,7 +102,14 @@ public: // Constructor for generalised creation from data wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth = 1); - + + // creates an bitmap from the native image format + wxBitmap(CGImageRef image); + wxBitmap(WX_NSImage image); + + // Create a bitmap compatible with the given DC + wxBitmap(int width, int height, const wxDC& dc); + // If depth is omitted, will create a bitmap compatible with the display wxBitmap(int width, int height, int depth = -1) { (void)Create(width, height, depth); } wxBitmap(const wxSize& sz, int depth = -1) { (void)Create(sz, depth); } @@ -123,6 +132,15 @@ public: { return Create(sz.GetWidth(), sz.GetHeight(), depth); } virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1); + bool Create( CGImageRef image ); + bool Create( WX_NSImage image ); + + // Create a bitmap compatible with the given DC, inheriting its magnification factor + bool Create(int width, int height, const wxDC& dc); + + // Create a bitmap with a scale factor, width and height are multiplied with that factor + bool CreateScaled(int logwidth, int logheight, int depth, double logicalScale); + // virtual bool Create( WXHICON icon) ; virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const; @@ -185,6 +203,7 @@ public: void *BeginRawAccess() ; void EndRawAccess() ; + double GetScaleFactor() const; protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;