1. [Win32Lib] Printing a Bitmap
- Posted by euphoric <euphoric at cklester.com> Feb 10, 2004
- 500 views
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"))
2. Re: [Win32Lib] Printing a Bitmap
- Posted by "Wolf" <wolfritz at king.igs.net> Feb 10, 2004
- 488 views
Here's a very old example, which can hopefully be simplified for later win32lib's, that worked for win32lib ver. 0.55.1 http://www.king.igs.net/~wolfritz/bits8.zip > My only problem now is that it print very tiny. How do I expand the > image to fill the page? I have an HP laserjet 2200 series printer.
3. Re: [Win32Lib] Printing a Bitmap
- Posted by euphoric <euphoric at cklester.com> Feb 11, 2004
- 472 views
C. K. Lester wrote: >Wolf wrote: > > >>Here's a very old example, which can hopefully be simplified for >>later win32lib's, that worked for win32lib ver. 0.55.1 >> >> >Thanks for that code, Wolf... I'm getting this error when I try to print >a bitmap that I've opened (printing the smiley face works fine): > > screw it all. my bitmap had too many colors. prints fine! :)