View Full Version : Printing in Win9x/NT
I need to print my scene programmatically. I've read conflicting reports about the ablility to render directly to the printer. I believe even the reports that said I could said that it only worked under NT. So rendering directly to the printer is out of the question.
So I looked at drawing to a bitmap and Blting it to the printer. That's great except that Win9X has a 16 limit on the size of bitmaps created using the CreateBitamp (and it's variants) API. You can only get a relatively small bitmap on a 24 bitperpixel printer.
Someone must have done this before. What is best way to get this done? Performance is an issue.
06-05-2000, 01:47 PM
Hm, do be honest I'm not really sure what you meant.
Under W95/W98 the praxis showed that it is the best to print an image using stripes.
So, you should not stretchblt a bitmap onto
a printer DC (if you have an Epson printer with 1440 dpi, it would require around 158 megabyte to print a DINA4 page (CMYK) as ONE bitmap).
Forget to send any bitmap that it is bigger than 16 megabyte to the printer (there will be ALLWAYS a printer driver that dont support that)
Well, that is at least my personal experiecene, proof me wrong if you can.
06-06-2000, 09:34 AM
You can never render directly to the printer. WinNT - well, sorta, but no. No printer supports opengl as a printing language. You have two options.
1) Do the bitmap thing. I've been doing that, and have no problems. Note to the other post, I stretchblt at a 2:1 ratio to a 1/2 size printer device (thus->full page). At 600dpi (HP ColorLaserJet 5M), its approximately 1.68 meg, 24 bit color.
2) If you use WinNT or better, you can use Enhanced MetaFiles. Ugly, Windows specific, and not very easy to use. I'm assuming you want to be using 9X anyways.
So suggestion, use the bitmap, ensure a low to mid resolution on the printer, and reduce the "quality (1/2 2:1)" of the image, and you'll be fine.
Unfortunatly I won't have control over what resolution my end users will be printing at so I've implement banding to keep each blted bitmap below 16M. I'll try using using 1/2 the page size and StretchBlting and see if the quality is okay (to avoid multiple passes required when banding)
Another question along the same lines. Has anyone successfully printed to a Postscript printer under Win9X? I have no problems under NT. Any caveats anyone knows of?
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.