Hello.
In prof2.84, I was able to perform a print preview definitely as follows.
However, In prof2.85, it is displayed greatly.
Print and a preview are not possible normally.
I am troubled.
Please teach an improvement method
http://ifreeta.dee.cc/20090410/SampleMuPrintGrid_GDIPlus2.lzh
About the method that we adopt
I make the wmf file of the dummy.
I acquire the dot domain that I can print from the dummy file.
I draw in the dot domain.
CSize csSize;
CString csStr;
csStr = MetafileCache_GetFolder();
csStr += "metafilesizeget123.emf";
if ( _access( csStr , 0) == 0 ) {
DeleteFile( csStr );
}
CMetaFileDC dcEMF;
if( ! dcEMF.CreateEnhanced(
NULL,
csStr,
rcEmfExtent,
NULL
)
)
{
//
ASSERT( FALSE );
throw 0;
}
dcEMF.SetBkColor ( RGB(255,255,255) );
dcEMF.SaveDC();
dcEMF.RestoreDC( -1 );
HENHMETAFILE hEMF = dcEMF.CloseEnhanced();
DeleteEnhMetaFile( hEMF );
WCHAR wszText[1024];
MultiByteToWideChar(
CP_UTF8, 0,
csStr.GetBuffer(256),
strlen(csStr.GetBuffer(256))+1,
wszText,
(int)sizeof(wszText)
);
Gdiplus::Metafile metafile( wszText );
Gdiplus::MetafileHeader mtfHeader;
metafile.GetMetafileHeader(&mtfHeader);
csSize.cx = mtfHeader.Width;
csSize.cy = mtfHeader.Height;
return csSize;