Re: Image dimensions on a graphics object



You can work out the physical image size yourself from the image resolution
and pixel count.

When drawn NOT using the GraphicsUnit.Pixel measurement an image will be
scaled according to these dimensions.

Physical X size in inches= PixelCount / Image.Resolution :. float
sizeX=(float)img.Width / img.HorizontalResolution;

Somewhat similar for vertical resolutions too

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"Don Huan" <don@xxxxxxxxx> wrote in message
news:OwV6NOrZFHA.3620@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I'm currently working on a printing function and want to draw an image
> right-aligned on a page (untill right margin).
> To accomplish this, I need to know the image width *on that Graphics
> surface*. With Image.Width I get only real pixel sizes. I'm looking for a
> function like "MeasureString()" but for Images.
>
> Thank you for any help
>
> --
> Konstantin Gonikman
> http://www.kostik.de


.