Click to See Complete Forum and Search --> : Blting to the Printer
gwdash
Aug 12th, 2000, 06:44 PM
I have the DC of some thing i want to print. How do i "blt" it to the printer with out doing this:
BitBlt frmMain.Picture1.hDC, 0, 0, Screen.Width, Screen.Height, DC, 0, 0, vbSrcCopy
Printer.Print frmMain.Picture1.Picture
Do i have to do this, or can i blt directly to the printer?
Sam Finch
Aug 12th, 2000, 08:01 PM
the printerhas an hDC property just like a picture box or a form, (Printer.hDC)
so try something like
BitBlt Printer.hDC, 0, 0, Screen.Width, Screen.Height, DC, 0, 0, vbSrcCopy
Printer.EndDoc
gwdash
Aug 12th, 2000, 08:02 PM
tried that, didn't work, nothing happend
Sam Finch
Aug 12th, 2000, 08:18 PM
did it print out a blank page or just do nothing.
gwdash
Aug 12th, 2000, 08:39 PM
Did nothing
Sam Finch
Aug 12th, 2000, 08:48 PM
oh god, I remember, VB won't print out the page unless it thinks there's something on it, if you just use the API then it doesn't register that you've printed to it.
try this
Printer.Print " "
BitBlt frmMain.Picture1.hDC, 0, 0, Screen.Width, Screen.Height, DC, 0, 0, vbSrcCopy
Printer.Print frmMain.Picture1.Picture
gwdash
Aug 12th, 2000, 08:55 PM
I will try that a little later
oetje
Aug 13th, 2000, 03:59 AM
Also try to add a Printer.Newpage. If vb doesn't get that command, it prints everything except the last page.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.