ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 PrintImage - issue

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
graph_man Posted - Oct 19 2017 : 12:07:14
PrinterSetupDialog1->Execute();

Size => FitToPage

ImageEnView1->IO->PrintImage(MyPrinter->Canvas,MarginLeft,MarginTop,
MarginRight,MarginBottom,VerticalPos,HorizontalPos,
Size,SpecWidth,SpecHeight,GammaCorrection);


I try to change the paper size in the PrinterSetupDialog1
but the printed pages are the same size


ps
In previous versions of ImageEn, this worked without problems.
6   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Oct 24 2017 : 21:01:27
Sorry, we were not of more help. Still catching up after our holiday.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
graph_man Posted - Oct 24 2017 : 14:07:21
I have found a solution.
graph_man Posted - Oct 20 2017 : 05:25:51
Program works again after removing this code (after PrinterSetupDialog1 and before PrintImage):

if (PrintCopies > 0)
{
	Printers::TPrinterOrientation orient2 = MyPrinter->Orientation;

	wchar_t ADevice[MAX_PATH];      // Printer Name                 ADevice[CCHDEVICENAME]
	wchar_t ADriver[MAX_PATH];      // Name of driver               ADriver[MAX_PATH]
	wchar_t APort[MAX_PATH];        // PortName/File/UNC Path       APort[MAX_PATH]
	THandle ADeviceMode;    // Handle to the memory area containing the DEVMODE structure
	PDEVMODE DevMode;       

	MyPrinter->GetPrinter(ADevice, ADriver, APort, ADeviceMode);

	if (ADeviceMode)
	{
		DevMode = (PDEVMODE)GlobalLock((void*)ADeviceMode);  

		if (DevMode != NULL)
		{
			DevMode->dmCopies = PrintCopies;

			if (prn_collate == true)
			{
				DevMode->dmCollate = DMCOLLATE_TRUE;
			}
			else
			{
				DevMode->dmCollate = DMCOLLATE_FALSE;
			}

			if (orient2 == poLandscape) DevMode->dmOrientation = DMORIENT_LANDSCAPE;
			if (orient2 == poPortrait) DevMode->dmOrientation = DMORIENT_PORTRAIT;

			//DevMode->dmFields = DM_COLLATE | DM_COPIES;
			DevMode->dmFields = DM_COLLATE | DM_COPIES | DM_ORIENTATION;

			MyPrinter->SetPrinter(ADevice, ADriver, APort, ADeviceMode);
		}

		GlobalUnlock(DevMode);
	}
}



Why? How to fix it?

I need to change
DevMode->dmCopies
DevMode->dmCollate
DevMode->dmOrientation

Is there other way?
graph_man Posted - Oct 20 2017 : 03:30:55
this was last year's version

I need to use
PrinterSetupDialog1->Execute();

to choose a printer and paper size
and print using

ImageEnView1->IO->PrintImage

Ho todo that?
xequte Posted - Oct 20 2017 : 00:38:32
Hi

There should be no recent changes that affect this. Can you confirm what version you were using previously that worked as expected so I can compare the code.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
graph_man Posted - Oct 19 2017 : 14:38:39
TPrinter *MyPrinter;