Merged 47990 and 47991 from trunk:

Add wxBitmap constructors and Create methods to allow creating a wxBitmap from an NSBitmapImageRep or NSImage instance.
Copyright 2007 Software 2000 Ltd.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@47992 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Elliott
2007-08-09 19:08:30 +00:00
parent 3a26d6e324
commit 94d815b39e
2 changed files with 43 additions and 0 deletions

View File

@@ -77,6 +77,10 @@ public:
wxBitmap(const char* const* bits);
// Load a file or resource
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE);
// Construct from Cocoa's NSImage
wxBitmap(NSImage* cocoaNSImage);
// Construct from Cocoa's NSBitmapImageRep
wxBitmap(NSBitmapImageRep* cocoaNSBitmapImageRep);
// Constructor for generalised creation from data
wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth = 1);
// If depth is omitted, will create a bitmap compatible with the display
@@ -98,6 +102,8 @@ public:
bool CreateFromImage(const wxImage& image, int depth=-1);
virtual bool Create(int width, int height, int depth = -1);
bool Create(NSImage* cocoaNSImage);
bool Create(NSBitmapImageRep* cocoaNSBitmapImageRep);
virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1);
virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE);
virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const;