X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/96dabe431382e288fc1ccc561f62c400895ac0fa..ad60f9e7b66d326505592cc6dae034cab5826f3b:/src/osx/core/bitmap.cpp?ds=sidebyside diff --git a/src/osx/core/bitmap.cpp b/src/osx/core/bitmap.cpp index 0b4dfcf11a..563eaf515a 100644 --- a/src/osx/core/bitmap.cpp +++ b/src/osx/core/bitmap.cpp @@ -791,8 +791,8 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon) int w = icon.GetWidth() ; int h = icon.GetHeight() ; - Create( icon.GetWidth() , icon.GetHeight() ) ; -#ifndef __WXOSX_IPHONE__ + Create( w , h ) ; +#ifdef __WXOSX_CARBON__ if ( w == h && ( w == 16 || w == 32 || w == 48 || w == 128 ) ) { IconFamilyHandle iconFamily = NULL ; @@ -974,7 +974,7 @@ wxGDIRefData* wxBitmap::CreateGDIRefData() const wxGDIRefData* wxBitmap::CloneGDIRefData(const wxGDIRefData* data) const { - return new wxBitmapRefData(*wx_static_cast(const wxBitmapRefData *, data)); + return new wxBitmapRefData(*static_cast(data)); } void * wxBitmap::GetRawAccess() const @@ -1021,6 +1021,16 @@ IconRef wxBitmap::CreateIconRef() const } #endif +#if wxOSX_USE_COCOA_OR_IPHONE + +WX_NSImage wxBitmap::GetNSImage() const +{ + wxCFRef< CGImageRef > cgimage(CreateCGImage()); + return wxOSXCreateNSImageFromCGImage( cgimage ); +} + +#endif + wxBitmap wxBitmap::GetSubBitmap(const wxRect &rect) const { wxCHECK_MSG( Ok() && @@ -1693,7 +1703,7 @@ void wxBitmap::InitStandardHandlers() #if !defined( __LP64__ ) && !defined(__WXOSX_IPHONE__) AddHandler( new wxPICTResourceHandler ) ; #endif -#if wxOSX_USE_COCOA_OR_CARBON +#if wxOSX_USE_CARBON AddHandler( new wxICONResourceHandler ) ; #endif }