views:

115

answers:

1

A simple question - If I want to print a picture so it best fits the page in C#, do I have to scale it to the dimensions of the page myself ?

I've noticed the many good answers about how-to scale, I just want to know If I need to scale myself, as the scaling isn't a part of an image processing, it's only for the sake of the printing.

(a simple yes (if it's the answer) would do)

Edit: Currently I'm scaling using:

e.Graphics.DrawImage(my_image, destRect, srcRect, GraphicsUnit.Pixel);

Whereas destRect is a rectangle of the dimensions of the wanted output, I've done a simple algorithm to set this destRect to optimal sizes while preserving the original aspect ratio. (btw I'm not happy with this simple scaling, as it lacks in Image quality, will probably update to something fancier if I must).

But I've wanted to know if there's some auto-scaling provided by the framework for printing purposes, I really don't want to re-invent this wheel..

+1  A: 

I'm not sure if this is as simple as yes/no. I suspect that you must still use GDI+ and the Graphics object, so scaling is as simple as calling Graphics.DrawImage(...) on the graphics object for the printing device. Some printer drivers might support scaling the source automatically, though.

Cecil Has a Name