]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/core/bitmap.cpp
wxSplitterWindow mouse capture improvements and cleanup.
[wxWidgets.git] / src / osx / core / bitmap.cpp
index 15e8a233f0d95615dca87e81808b0e551ec0cbcb..a2f766043501e896312bd65b3bcf33e7c2852d10 100644 (file)
@@ -287,8 +287,8 @@ bool wxBitmapRefData::Create( int w , int h , int d )
     m_depth = d ;
     m_hBitmap = NULL ;
 
-    m_bytesPerRow = GetBestBytesPerRow( w * 4 ) ;
-    size_t size = m_bytesPerRow * h ;
+    m_bytesPerRow = GetBestBytesPerRow( m_width * 4 ) ;
+    size_t size = m_bytesPerRow * m_height ;
     void* data = m_memBuf.GetWriteBuf( size ) ;
     if ( data != NULL )
     {
@@ -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() &&