Results 1 to 8 of 8

Thread: Blting to the Printer

  1. #1

    Thread Starter
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    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?
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    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

  3. #3

    Thread Starter
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    tried that, didn't work, nothing happend
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  4. #4
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    did it print out a blank page or just do nothing.

  5. #5

    Thread Starter
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    Did nothing
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  6. #6
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    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

  7. #7

    Thread Starter
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    I will try that a little later
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  8. #8
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    Also try to add a Printer.Newpage. If vb doesn't get that command, it prints everything except the last page.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width