No announcement yet.

Printing a Bitmap

  • Filter
  • Time
  • Show
Clear All
new posts

  • Don Dickinson
    You should look at the sample that I posted (see lance's message).
    The reason that your code doesn't work is that BitBlt doesn't work on a bunch or printers. It will work on some. If you're printing a monochrome bitmap it should work on almost all. But for color you really should use DIBs.

    Best Regards,

    Leave a comment:

  • Lance Edmonds
    There is an excellent example of printing a color BMP by Don Dickinson in the FILES area of the PB web site...

    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:

  • James GrahamEagle
    Guest started a topic Printing a Bitmap

    Printing a Bitmap

    I am having trouble printing a bitmap. The code below works
    with my Epson 1500 Laser, gives a black & white copy of the
    (color) bitmap on a color postscript printer and garbage on
    an HP 712C. Can anybody help?

    In the code, all variables a long
    pdc = printer device context (no error getting this)
    hbm = handle of bitmap

    GetObject hbm, SIZEOF(bm), bm
    bmx = bm.bmWidth
    bmy = bm.bmHeight
    hdc = GetDC(Hwnd)
    mdc = CreateCompatibleDC(hdc)
    SelectObject mdc, hbm
    pdcmem = CreateCompatibleDC(pdc)
    pbm = CreateCompatibleBitmap(pdc, bmx, bmy)
    SelectObject pdcmem, pbm
    BitBlt pdcmem, 0, 0, bmx, bmy, mdc, 0, 0, %SRCCOPY
    BitBlt pdc, 0, 0, bmx, bmy, pdcmem, 0, 0, bmx, bmy, %SRCCOPY

    Now delete objects etc ...