Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Urgent: Printing Images in scale

$
0
0

Okay,

Simple, PrintDocument.PrintPage

PrintPageEventArgs.Graphics

Image (Bitmap);

PageBounds are 0,0,152,100

Image Size is 113,113

If I use:

e.Graphics.DrawImage(image, 0,0);

it prints the precise scale, but it in the wrong location.  So far, everything I've done to "center" the image, prints the image WRONG.  Typically too big.

I need to figure out what the DrawImage() is doing to turn that 113,113, into an image that is less than the e.PageBounds of 152,100;

I would typically do: 

X = ((pagewidth / 2) - (imagewidth / 2))
Y = ((pageheight / 2) - (imageheight / 2))

but since the "units" don't match the picture prints wrong.

The "GraphicsUnit" of the e.Graphics is listed as Display, but the Image of course is listed as Pixels.  I'm assuming there is a difference in units.  I need to the conversion process to provide a Rectangle to DrawImage that centers the Image on the page in the appropriate (natural) scale (meaning I don't want to resize the image, just center it).

Thanks

Jaeden "Sifo Dyas" al'Raec Ruiner




"Never Trust a computer. Your brain is smarter than any micro-chip."
PS - Don't mark answers on other people's questions. There are such things as Vacations and Holidays which may reduce timely activity, and until the person asking the question can test your answer, it is not correct just because you think it is. Marking it correct for them often stops other people from even reading the question and possibly providing the real "correct" answer.


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>