Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Print image
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Photos et traitement d'images
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01253570
Message ID:
01253712
Vues:
26
Ok, I got it working, thanks a lot.
Having more questions. What I print is a shipping label. It supposed to be 4x6 but what I am actually getting printed is much larger. Do I need to do any zooming? Is it actually going thru a printer driver?

Thanks again for help.

>You can issue a SET PRINTER TO NAME before calling the ToPrinter method or pass the printer name as the 2nd parameter to ToPrinter.
>
>
>FUNCTION ToPrinter
>LPARAMETERS tnStretch, tcPrinterName, tnOrientation, tnAlignment
>
>* tnStretch
>*   Specifies how an image is sized to fit inside a control. Available at design time and run time.
>*   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.
>
>
>
>>Thanks for help. I will try it as soon as I can. One question though. How do I specify a printer to print to?
>>
>>
>>>>>>I am converting GIFs encoded data into an unencoded and create a GIF file. Then I print it out. How can I print unencoded data directly to a printer?
>>>>>
>>>>>What do you mean by "encoded data"? It it base-64, or something like that?
>>>
>>>>Yes it is. I am decoding it and then I am creating a gif file. I want to skip file creation and print decoded data directly to the printer.
>>>
>>>You can use GDIPlusX for this. Download the library from here: http://www.codeplex.com/VFPX/Release/ProjectReleases.aspx
>>>
>>>Sample code:
>>>
>>>DO (LOCFILE("system.prg"))
>>>loStream = _SCREEN.System.IO.MemoryStream.New(STRCONV(lcEncodedGIF,14))
>>>loImg = _SCREEN.System.Drawing.Image.FromStream(loStream)
>>>loImg.ToPrinter()
>>>
>>>loImg = NULL
>>>loStream = NULL
>>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform