]> git.saurik.com Git - wxWidgets.git/commitdiff
iPhone bitmap support
authorStefan Csomor <csomor@advancedconcepts.ch>
Fri, 10 Jul 2009 17:33:43 +0000 (17:33 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Fri, 10 Jul 2009 17:33:43 +0000 (17:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61377 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/bitmap.h
src/osx/core/bitmap.cpp

index 9fd20675fb05bee2cd48e42bd1515f80500299dd..61420faaec5dd855df66e9608518283b9864c2a3 100644 (file)
@@ -166,9 +166,13 @@ public:
     // returns a CGImageRef which must released after usage with CGImageRelease
     CGImageRef CreateCGImage() const ;
 
-#if wxOSX_USE_COCOA_OR_IPHONE
+#if wxOSX_USE_COCOA
     // returns an autoreleased version of the image
     WX_NSImage GetNSImage() const;
+#endif
+#if wxOSX_USE_IPHONE
+    // returns an autoreleased version of the image
+    WX_UIImage GetUIImage() const;
 #endif
     // returns a IconRef which must be retained before and released after usage
     IconRef GetIconRef() const;
index 15e8a233f0d95615dca87e81808b0e551ec0cbcb..86df441f9da7d6a90d176016425d9e56908aabd7 100644 (file)
@@ -1019,7 +1019,7 @@ IconRef wxBitmap::CreateIconRef() const
 }
 #endif
 
-#if wxOSX_USE_COCOA_OR_IPHONE
+#if wxOSX_USE_COCOA
 
 WX_NSImage wxBitmap::GetNSImage() const
 {
@@ -1029,6 +1029,15 @@ WX_NSImage wxBitmap::GetNSImage() const
 
 #endif
 
+#if wxOSX_USE_IPHONE
+
+WX_UIImage wxBitmap::GetUIImage() const
+{
+    wxCFRef< CGImageRef > cgimage(CreateCGImage());
+    return wxOSXCreateUIImageFromCGImage( cgimage );
+}
+
+#endif
 wxBitmap wxBitmap::GetSubBitmap(const wxRect &rect) const
 {
     wxCHECK_MSG( Ok() &&