From: Stefan Csomor Date: Fri, 10 Jul 2009 17:33:43 +0000 (+0000) Subject: iPhone bitmap support X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4bea628d007cc8add79e6dee2863c7bdc1bccce5?ds=inline iPhone bitmap support git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61377 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/osx/bitmap.h b/include/wx/osx/bitmap.h index 9fd20675fb..61420faaec 100644 --- a/include/wx/osx/bitmap.h +++ b/include/wx/osx/bitmap.h @@ -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; diff --git a/src/osx/core/bitmap.cpp b/src/osx/core/bitmap.cpp index 15e8a233f0..86df441f9d 100644 --- a/src/osx/core/bitmap.cpp +++ b/src/osx/core/bitmap.cpp @@ -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() &&