X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/83c23edb02c271787db7f7e388a603a6b0a54f09..ae0e22dd7af3fa44819a08c21c9b478688e9d172:/src/osx/core/bitmap.cpp diff --git a/src/osx/core/bitmap.cpp b/src/osx/core/bitmap.cpp index 15e8a233f0..157cb84b51 100644 --- a/src/osx/core/bitmap.cpp +++ b/src/osx/core/bitmap.cpp @@ -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() && @@ -1162,7 +1171,7 @@ wxBitmap::wxBitmap(const wxImage& image, int depth) int height = image.GetHeight(); wxBitmapRefData* bitmapRefData; - + m_refData = bitmapRefData = new wxBitmapRefData( width , height , depth ) ; if ( bitmapRefData->IsOk()) @@ -1645,7 +1654,7 @@ WXHBITMAP wxMask::GetHBITMAP() const // Standard Handlers // ---------------------------------------------------------------------------- -#if !defined( __LP64__ ) && !defined(__WXOSX_IPHONE__) +#if !defined( __LP64__ ) && !defined(__WXOSX_IPHONE__) class WXDLLEXPORT wxPICTResourceHandler: public wxBitmapHandler {