-
I have the DC of some thing i want to print. How do i "blt" it to the printer with out doing this:
Code:
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?
-
the printerhas an hDC property just like a picture box or a form, (Printer.hDC)
so try something like
Code:
BitBlt Printer.hDC, 0, 0, Screen.Width, Screen.Height, DC, 0, 0, vbSrcCopy
Printer.EndDoc
-
tried that, didn't work, nothing happend
-
did it print out a blank page or just do nothing.
-
-
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
Code:
Printer.Print " "
BitBlt frmMain.Picture1.hDC, 0, 0, Screen.Width, Screen.Height, DC, 0, 0, vbSrcCopy
Printer.Print frmMain.Picture1.Picture
-
I will try that a little later
-
Also try to add a Printer.Newpage. If vb doesn't get that command, it prints everything except the last page.