PXCV_DrawPageToDC and MM_ANISOTROPIC hDC MapMode

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

Vitaly111
User
Posts: 4
Joined: Tue Oct 19, 2010 8:28 am

PXCV_DrawPageToDC and MM_ANISOTROPIC hDC MapMode

Post by Vitaly111 »

Dear Sirs.
Could you help me?

I use MM_ANISOTROPIC hDC Map Mode for drawing in my application;
I'll try to use PXCV_DrawPageToDC in that mode... but unsuccessfully.
Can I use PXCV_DrawPageToDC in MM_ANISOTROPIC mode or only MM_TEXT mode?
Vitaly.
User avatar
Chris - PDF-XChange
Site Admin
Posts: 798
Joined: Tue Apr 14, 2009 11:33 pm

Re: PXCV_DrawPageToDC and MM_ANISOTROPIC hDC MapMode

Post by Chris - PDF-XChange »

Hi Vitaly,

I think you have posted in the wrong product topic, are you using the ActiveX Viewer SDK?
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.


Chris Attrell
Tracker Sales & Support North America
http://www.tracker-software.com
Vitaly111
User
Posts: 4
Joined: Tue Oct 19, 2010 8:28 am

Re: PXCV_DrawPageToDC and MM_ANISOTROPIC hDC MapMode

Post by Vitaly111 »

Hi!
I use C++ PDF Viewer SDK.( PDF-XChange Viewer Pro SDK 2.056 SDK Base Pack )

So still have a problem with MM_ANISOTROPIC MapMode - I have black square instead PDFPage bitmap. Even if I use correct LPtoDP, DPtoLP... etc transformation.
When I use MM_TEXT mode all is OK and PDFPage draw to offscreen DC.
Vitaly
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: PXCV_DrawPageToDC and MM_ANISOTROPIC hDC MapMode

Post by Stefan - PDF-XChange »

Hello Vitaly,

Can you please try with the latest SDK build (2.5.189) and see if the problem still exists?

Best,
Stefan
Vitaly111
User
Posts: 4
Joined: Tue Oct 19, 2010 8:28 am

Re: PXCV_DrawPageToDC and MM_ANISOTROPIC hDC MapMode

Post by Vitaly111 »

Tracker Supp-Stefan wrote: Can you please try with the latest SDK build (2.5.189) and see if the problem still exists?
I've just try that SDK build - unlike problem still exist.
Vitaly.
Last edited by Vitaly111 on Wed Dec 15, 2010 9:27 pm, edited 1 time in total.
Vitaly111
User
Posts: 4
Joined: Tue Oct 19, 2010 8:28 am

Re: PXCV_DrawPageToDC and MM_ANISOTROPIC hDC MapMode

Post by Vitaly111 »

Hi,Stefan.
I've just try to add some lines of code:

Code: Select all

...
          //the calculation of the size Page in  custom  hDC   dimension 
           double fcx=0;
	double fcy=0;
	if (curDoc)
	{
		if (IS_DS_SUCCESS(PXCV_GetPageDimensions(curDoc,nPageNum,&fcx,&fcy)))
		{
			m_PageSize.cx=MulDiv(int(fcx),100,72);
			m_PageSize.cy=MulDiv(int(fcy),100,72);
		}

		
	}

...


...
           // mapping mode is MM_ANISOTROPIC
	// these extents setup a mode similar to MM_LOENGLISH
	// MM_LOENGLISH is in .01 physical inches
	// these extents provide .01 logical inches

	pDC->SetMapMode(MM_ANISOTROPIC);
	pDC->SetViewportExt(pDC->GetDeviceCaps(LOGPIXELSX), pDC->GetDeviceCaps(LOGPIXELSY));
	pDC->SetWindowExt(100, -100);

	// set the origin of the coordinate system to the center of the page
	CPoint ptOrg;
	ptOrg.x = GetDocument()->m_PageSize.cx/2;
	ptOrg.y = GetDocument()->m_PageSize.cy/2;

	// ptOrg is in logical coordinates
	pDC->OffsetWindowOrg(-ptOrg.x,ptOrg.y);
...

                      PXV_CommonRenderParameters dp;
		dp.WholePageRect = (LPRECT)rcWindow;
		dp.DrawRect =(LPRECT)client;
		dp.Flags = 0;
		dp.RenderTarget = pxvrm_Viewing;
		hr=PXCV_DrawPageToDC(curDoc, 0, pDC->GetSafeHdc(), &dp);
		//pDC->Rectangle(client);
rcWindow= {top=550 bottom=-550 left=-425 right=425};
client = {top=550 bottom=-265 left=-425 right=408};

I had black square as result.
I've uncommented //pDC->Rectangle(client);
I have rectangle at right place;


Vitaly.
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: PXCV_DrawPageToDC and MM_ANISOTROPIC hDC MapMode

Post by John - Tracker Supp »

Hi Vitally,

I understand this problem is now resolved after direct contact and a fix for all users will be available in the next release.

Thanks for your assistance.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com