]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/core/bitmap.cpp
Add wxBitmap(NSImage*) ctor to wxOSX.
[wxWidgets.git] / src / osx / core / bitmap.cpp
index 1161256016c7fb4698c8f448c51a1c53984d12aa..22efcde42a143c08c02db1a68b85e9782344e96e 100644 (file)
@@ -1005,6 +1005,17 @@ IconRef wxBitmap::CreateIconRef() const
 
 #if wxOSX_USE_COCOA
 
+wxBitmap::wxBitmap(WX_NSImage image)
+{
+    (void)Create(image);
+}
+
+bool wxBitmap::Create(WX_NSImage image)
+{
+    wxCFRef<CGImageRef> cgimage(wxOSXCreateCGImageFromNSImage(image));
+    return Create(cgimage);
+}
+
 WX_NSImage wxBitmap::GetNSImage() const
 {
     wxCFRef< CGImageRef > cgimage(CreateCGImage());