Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Handling of CExtPPVW is changed, and I am troubled. Collapse All
Subject Author Date
tera tera Apr 9, 2009 - 10:56 PM

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;

Technical Support Apr 13, 2009 - 1:17 PM

Here is the modified version of your test project:

http://www.prof-uis.com/download/forums/tmp/MODIFIED-000-SampleMuPrintGrid_GDIPlus2.zip

We changed the coordinate computation and painting code.