>Hi All
>we use a 3rd party activex to display/manipulate images. all works fine except print. everytime we call print method it loads print dialog box and users have to select all settings again for e.g. "fit to page" .
>i want to overwrite this print command, instead of using activex control's print command i am thinking of operating system's built in printing functionality (e.g. photo printing wizard in xp). my question is how do i can i launch this wizard or do you have any better solutions for me ?
>Thanks for the advise.
>btw the company we bought control no longer operational so cant contact them for update.
Hi Rajani,
You can use GdiPlusX for that.
DO LOCFILE("System.app")
WITH _Screen.System.Drawing
LOCAL loBmp as xfcBitmap
loBmp = .Bitmap.FromFile(GETPICT())
loBmp.ToPrinter()
ENDWITH
the method "ToPrinter" allows you to customize the image printing in many ways.
Have a look at the parameters allowed:
Parameters: tnStretch, tcPrinterName, tnOrientation, tnAlignment
tnStretch
* Specifies how an image is sized to fit inside a control.
* 0 - Clip. The image is clipped to fit the page. (Default)
* 1 - Isometric. The image resizes to fit the page while maintaining its original proportions.
* 2 - Stretch. The image resizes to fit the page, but does not maintain its original proportions.
tcPrinterName
* Specifies the name of the printer, the same of GETPRINTER()
tnOrientation:
* 0 - Portrait
* 1 - Landscape
tnAlignment
* Specifies a numerical value representing the alignment of the image in the page.
* 0 - Vertically Centered Left.
* 1 - Vertically Centered Right.
* 2 - Centered. Centers image vertically and horizontally.
* 4 - Top Left. Aligns image in top left corner of the page.
* 5 - Top Right. Aligns image in top right corner of the page.
* 6 - Top Center. Aligns image at the top and horizontally centered on the page.
* 7 - Bottom Left. Aligns image in the bottom left corner of the page.
* 8 - Bottom Right. Aligns image in bottom right corner of the page.
* 9 - Bottom Center. Aligns image at the bottom and vertically centered on the page.
More info here:
http://weblogs.foxite.com/vfpimaging/archive/2008/05/26/6108.aspxYou may download GdiPlusX library directly from CodePlex / VFPX
http://www.codeplex.com/VFPX/Wiki/View.aspx?title=GDIPlusX&referringTitle=HomeHope this helps !
Cesar