X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/20b6985553b4e01e7960847e3211d940aeff8742..914955aaa034862c3b9b827463cde26455d06c79:/src/mac/carbon/dataobj.cpp diff --git a/src/mac/carbon/dataobj.cpp b/src/mac/carbon/dataobj.cpp index 234f49899a..65401b5f33 100644 --- a/src/mac/carbon/dataobj.cpp +++ b/src/mac/carbon/dataobj.cpp @@ -24,14 +24,18 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_DATAOBJ + #ifndef WX_PRECOMP #include "wx/intl.h" #endif #include "wx/log.h" #include "wx/dataobj.h" +#include "wx/dcmemory.h" #include "wx/mstream.h" #include "wx/image.h" +#include "wx/metafile.h" #include "wx/mac/private.h" #include @@ -250,9 +254,8 @@ wxBitmapDataObject::wxBitmapDataObject( Init(); if ( m_bitmap.Ok() ) { - /* - m_pictHandle = m_bitmap.GetBitmapData()->GetPict( &m_pictCreated ) ; - */ + m_pictHandle = m_bitmap.GetBitmapData()->GetPictHandle() ; + m_pictCreated = false ; } } @@ -269,9 +272,8 @@ void wxBitmapDataObject::SetBitmap( wxBitmapDataObjectBase::SetBitmap(rBitmap); if ( m_bitmap.Ok() ) { - /* - m_pictHandle = m_bitmap.GetBitmapData()->GetPict( &m_pictCreated ) ; - */ + m_pictHandle = m_bitmap.GetBitmapData()->GetPictHandle() ; + m_pictCreated = false ; } } @@ -320,10 +322,16 @@ bool wxBitmapDataObject::SetData( // ownership is transferred to the bitmap m_pictCreated = false ; Rect frame = (**picHandle).picFrame ; - /* - m_bitmap.GetBitmapData()->SetPict( (WXHMETAFILE) picHandle ) ; - m_bitmap.SetWidth( frame.right - frame.left ) ; - m_bitmap.SetHeight( frame.bottom - frame.top ) ; - */ + + wxMetafile mf ; + mf.SetHMETAFILE( (WXHMETAFILE) m_pictHandle ) ; + wxMemoryDC mdc ; + m_bitmap.Create( frame.right - frame.left ,frame.bottom - frame.top ) ; + mdc.SelectObject(m_bitmap ) ; + mf.Play( &mdc ) ; + mdc.SelectObject( wxNullBitmap ) ; + return m_bitmap.Ok(); } + +#endif \ No newline at end of file