tags:

views:

160

answers:

3
A: 

I suppose that you're not scaling your report to the printer's resolution. Typical screen resolution is 72 DPI (sometimes 96 DPI). Printer resolution can be 300DPI, 600DPI or higher.

You should repaint the report to the printer DC with all coordinates and sizes scaled to the printer's resolution.

Wacek
A: 

Your printer has a lot more dots per inch than your screen. You will need to scale things to fit the printed page a bit better.

Try using StretchBlt() instead of BitBlt().

Michael J
A: 

As others have said, this is because, in general, the display resolution of printers is a lot higher than displays. Displays are usually 96 to 120DPI: at 96DPI this means that an image of 96 pixels (dots) by 96 pixels occupies approximately 1 square inch on the display. However, if you just take that image and print it out on a 600DPI printer, the size of the image will be about 1/6" by 1/6" - much smaller. This is a bane of the publishing world - images that look fine on displays often look either tiny or terrible when printed.

You could, as has been suggested, use StretchBlt rather than BitBlt to scale up your image. Depending on the difference between your display and printer, this will either look a bit blocky, or utterly hideously blocky.

A much better option is to rewrite your code that does the drawing of the control so that you've got a method that takes a device context (and some co-ordinates) and draws into it. Your normal window painting code can pass the memory DC to this routine and then BitBlt the result to the window, and your painting code can call this method with the printer DC and some suitable co-ordinates.

When writing this routine you'll have to worry about scaling: for example, you'll need to create fonts for the given device context, and with a scaling-indepdendant size (that is, specify the font size in points, not pixels), rather than relying on a pre-created font.

DavidK
this works, i figured out the reason for tiny appearance is that the print DC has more pixels than the screen DC. Due to this all the font sizes appear small on print. Therefore I wrote my drawing logic to print using new font sizes passing the print DC. This way it took almost the entire page.thanx all.