Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing a screen capture
Message
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00263527
Message ID:
00263629
Vues:
15
>I have written a "print screen" routine in VB6, but I am having trouble getting the print out to look correct and some finer points of the printing working.
>
>The problems:
>1) I put the caputured screen bitmap onto a form and print it. Is this is the best way to do it? Currently the bitmap is clipped because the form is not big enough, how can I get it stretch/shrink itself into the form.

You might look at busing ShellExecute() to print it by saving it to a file and running ShellExecute() agaunst the BMP with the verb "PRINT" rsther than the default "OPEN" action. If you have Dan Appleman's VB Win32 book, there sample code that's close to what you need

>2) When I issue the form1.printform command, the printout is send directly to the default printer. I would instead like the Windows print diallog to come up. This would allow the user to set various properties of the print job.
>
>Sub Main()
>    Clipboard.Clear
>    keybd_event vbKeySnapshot, TheScreen, 0&, 0&
>    DoEvents
>    Form1.Picture = Clipboard.GetData()
>    Form1.PrintForm
>    End
>End Sub
>
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform