コード例 #1
0
void VPictureData_EMF::FromMacHandle(void* inMacHandle)
{
	_ReleaseDataProvider();
	_DisposeMetaFile();
	if(inMacHandle)
	{
		VSize datasize=GetMacAllocator()->GetSize(inMacHandle);
		if(datasize)
		{
			fPicHandle=GetMacAllocator()->Allocate(GetMacAllocator()->GetSize(inMacHandle));
			if(fPicHandle)
			{
				GetMacAllocator()->Lock(fPicHandle);
				GetMacAllocator()->Lock(inMacHandle);
				CopyBlock(*(char**)inMacHandle,*(char**)fPicHandle,datasize);
				GetMacAllocator()->Unlock(fPicHandle);
				GetMacAllocator()->Unlock(inMacHandle);
			}
		}
		else
			fPicHandle=NULL;
	}
	else
	{
		fPicHandle=NULL;
	}
}
コード例 #2
0
VPictureData_EMF::~VPictureData_EMF()
{
	if(fPicHandle)
	{
		GetMacAllocator()->Free(fPicHandle);
	}
	_DisposeMetaFile();
}
コード例 #3
0
VPictureData_MacPicture::~VPictureData_MacPicture()
{
	if (fPicHandle && GetMacAllocator())
	{
		if (GetMacAllocator()->CheckBlock(fPicHandle))
			GetMacAllocator()->Free(fPicHandle);
	}
	_DisposeMetaFile();
}
コード例 #4
0
void VPictureData_MacPicture::_DoReset()const
{
	_DisposeMetaFile();
	if (fPicHandle && GetMacAllocator())
	{
		GetMacAllocator()->Free(fPicHandle);
		fPicHandle = 0;
	}
}
コード例 #5
0
void VPictureData_MacPicture::DoDataSourceChanged()
{
	if (fPicHandle && GetMacAllocator())
	{
		GetMacAllocator()->Free(fPicHandle);
		fPicHandle = 0;
	}
	_DisposeMetaFile();
}
コード例 #6
0
void VPictureData_GDIPlus_Vector::_FromEnhMetaFile(HENHMETAFILE inMetaFile)
{
	SetDataProvider(0,false);
	_DisposeMetaFile();
	
	_SetDecoderByExtension("emf");
	
	fMetafile=new Gdiplus::Metafile(inMetaFile,true);
	_InitSize();
}
コード例 #7
0
void VPictureData_EMF::FromEnhMetaFile(HENHMETAFILE inMetaFile)
{
	_ReleaseDataProvider();
	_DisposeMetaFile();
	fMetaFile=inMetaFile;
	ENHMETAHEADER header;
	if(GetEnhMetaFileHeader(fMetaFile,sizeof(ENHMETAHEADER),&header))
	{
		fBounds.SetCoords(0,0,header.rclBounds.right-header.rclBounds.left,header.rclBounds.bottom-header.rclBounds.top);
	}
}
コード例 #8
0
void VPictureData_GDIPlus_Vector::_DoLoad()const
{
	_DisposeMetaFile();
	if(fDataProvider)
	{
		const VPictureCodec* decoder=fDataProvider->RetainDecoder();
		if(decoder)
		{
			fMetafile=decoder->_CreateGDIPlus_Metafile(*fDataProvider);
			_InitSize();
		}
	}
}
コード例 #9
0
void VPictureData_EMF::_DoLoad()const
{
	_DisposeMetaFile();
	if(fDataProvider)
	{
		fMetaFile=::SetEnhMetaFileBits((UINT)fDataProvider->GetDataSize(),(uBYTE*)fDataProvider->BeginDirectAccess());
		fDataProvider->EndDirectAccess();
		if(fMetaFile)
		{
			ENHMETAHEADER header;
			if(GetEnhMetaFileHeader(fMetaFile,sizeof(ENHMETAHEADER),&header))
			{
				fBounds.SetCoords(0,0,header.rclBounds.right-header.rclBounds.left,header.rclBounds.bottom-header.rclBounds.top);
			}
		}
	}
}
コード例 #10
0
void VPictureData_EMF::FromMetaFilePict(METAFILEPICT* inMetaPict)
{
	HENHMETAFILE henh;
	_ReleaseDataProvider();
	_DisposeMetaFile();
	
	void*        lpWinMFBits;
	UINT         uiSizeBuf;

	uiSizeBuf = GetMetaFileBitsEx(inMetaPict->hMF, 0, NULL);
	lpWinMFBits = GlobalAllocPtr(GHND, uiSizeBuf);
	GetMetaFileBitsEx(inMetaPict->hMF, uiSizeBuf, (LPVOID)lpWinMFBits);
	henh = SetWinMetaFileBits(uiSizeBuf, (LPBYTE)lpWinMFBits, NULL, inMetaPict);
	GlobalFreePtr(lpWinMFBits);


	FromEnhMetaFile(henh);
}
コード例 #11
0
void VPictureData_EMF::_DoReset()const
{
	_DisposeMetaFile();
}
コード例 #12
0
void VPictureData_GDIPlus_Vector::_DoReset()const
{
	_DisposeMetaFile();
}