void VPictureData_MacPicture::_DisposeMetaFile()const
{
	if (fMetaFile)
	{
#if VERSIONWIN
		DeleteEnhMetaFile(fMetaFile);
#else
		QDPictRelease(fMetaFile);
#endif
		fMetaFile = NULL;
	}
	if (fTrans)
	{
#if VERSIONWIN
#if ENABLE_D2D
		VWinD2DGraphicContext::ReleaseBitmap(fTrans);
#endif
		delete fTrans;
#elif VERSIONMAC
		CFRelease(fTrans);
#endif
		fTrans = NULL;
	}
#if VERSIONWIN
	if (fGdiplusMetaFile)
		delete fGdiplusMetaFile;
	fGdiplusMetaFile = 0;
#endif
}
Ejemplo n.º 2
0
wxMetafileRefData::~wxMetafileRefData(void)
{
    if (m_metafile)
    {
        KillPicture( (PicHandle) m_metafile ) ;
        m_metafile = 0;
#if wxMAC_USE_CORE_GRAPHICS
        QDPictRelease( m_qdPictRef ) ;
        m_qdPictRef = NULL ;
#endif
    }
}
Ejemplo n.º 3
0
void wxMetafile::SetPICT(void* pictHandle)
{
    UnRef();

    Handle picHandle = (Handle) pictHandle;
    HLock(picHandle);
    CFDataRef data = CFDataCreateWithBytesNoCopy( kCFAllocatorDefault, (const UInt8*) *picHandle, GetHandleSize(picHandle), kCFAllocatorNull);
    wxCFRef<CGDataProviderRef> provider(wxMacCGDataProviderCreateWithCFData(data));
    QDPictRef pictRef = QDPictCreateWithProvider(provider);
    CGRect rect = QDPictGetBounds(pictRef);
    m_refData = new wxMetafileRefData(static_cast<int>(rect.size.width),
                                      static_cast<int>(rect.size.height));
    QDPictDrawToCGContext( ((wxMetafileRefData*) m_refData)->GetContext(), rect, pictRef );
    CFRelease( data );
    QDPictRelease( pictRef );
    ((wxMetafileRefData*) m_refData)->Close();
}