[Win32Lib] Printing a Bitmap

new topic     » topic index » view thread      » older message » newer message

Is there anything wrong with the following code? The output is all 
wrong; the bitmap prints out extremely tiny and it prints out a 
screenshot, not the bitmap I want (I'm guessing it's taking video memory 
from whatever screen origin I give it). Derek, should I be printing a 
pixmap instead of a bitmap or window control? Where am I going wrong? 
Thanks!!!

procedure bttn_Print_onClick (integer self, integer event, sequence 
params)--params is ()
-- this will print the bitmap
sequence lPrt, lBmpSize, bitMap2Use
atom MainWin, cvrbmp

bitMap2Use = current_dir() & "\\images\\mytestbitmap.bmp"

MainWin =
     create( Window, "Printing BMP", 0, Default, Default, 0, 0,
     {WS_DLGFRAME,WS_POPUP,WS_CAPTION} )

cvrbmp =
     create( Bitmap, bitMap2Use, MainWin, 0, 0, 0,0,SS_NOTIFY)
lBmpSize = getCtlSize(cvrbmp)
setClientRect(MainWin, lBmpSize[1], lBmpSize[2])

   lPrt = getPrintChoice(1,0,0)
    void = startDoc("PrintBitmap")
    void = startPage()
    wPuts({Printer, 0, 0}, "Bitmap Print Test")
    bitBlt( Printer, 0, 30, MainWin, 0, 0, lBmpSize[1], lBmpSize[2], 
SRCCOPY )
    void = endPage()
    void = endDoc()
    releasePrinter()
    destroy( MainWin )
    destroy( cvrbmp )
end procedure
setHandler( bttn_Print, w32HClick, routine_id("bttn_Print_onClick"))

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu