err = GraphicsExportDoExport(exporter, NULL);
CGImageRelease( imageRef );
- size_t handleSize = GetHandleSize( (Handle) m_pictHandle );
- // the 512 bytes header is only needed for pict files, but not in memory
- if ( handleSize >= 512 )
- {
- memmove( *m_pictHandle , (char*)(*m_pictHandle)+512, handleSize - 512 );
- SetHandleSize( (Handle) m_pictHandle, handleSize - 512 );
- }
+ size_t handleSize = GetHandleSize( (Handle) m_pictHandle );
+ // the 512 bytes header is only needed for pict files, but not in memory
+ if ( handleSize >= 512 )
+ {
+ memmove( *m_pictHandle , (char*)(*m_pictHandle)+512, handleSize - 512 );
+ SetHandleSize( (Handle) m_pictHandle, handleSize - 512 );
+ }
}
CloseComponent( exporter );
}
Free() ;
}
+
+
+// ----------------------------------------------------------------------------
+// wxBitmap
+// ----------------------------------------------------------------------------
+
bool wxBitmap::CopyFromIcon(const wxIcon& icon)
{
bool created = false ;
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 ;
return true;
}
-wxBitmap::wxBitmap()
-{
-}
-
-wxBitmap::~wxBitmap()
-{
-}
-
wxBitmap::wxBitmap(const char bits[], int the_width, int the_height, int no_bits)
{
wxBitmapRefData* bitmapRefData;
} /* bitmapRefData->IsOk() */
}
-wxBitmap::wxBitmap(int w, int h, int d)
-{
- (void)Create(w, h, d);
-}
-
wxBitmap::wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth)
{
(void) Create(data, type, width, height, depth);
wxGDIRefData* wxBitmap::CloneGDIRefData(const wxGDIRefData* data) const
{
- return new wxBitmapRefData(*wx_static_cast(const wxBitmapRefData *, data));
+ return new wxBitmapRefData(*static_cast<const wxBitmapRefData *>(data));
}
void * wxBitmap::GetRawAccess() 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() &&
wxMask *wxBitmap::GetMask() const
{
- wxCHECK_MSG( Ok(), (wxMask *) NULL, wxT("invalid bitmap") );
+ wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") );
return M_BITMAPDATA->m_bitmapMask;
}
#if !defined( __LP64__ ) && !defined(__WXOSX_IPHONE__)
AddHandler( new wxPICTResourceHandler ) ;
#endif
-#if wxOSX_USE_COCOA_OR_CARBON
+#if wxOSX_USE_CARBON
AddHandler( new wxICONResourceHandler ) ;
#endif
}