i want to find the Image Height and Width in cm/inch/mm format.
i used the following code:
Image img = Image.FromFile("image path");
double iHeight = img.Height;
double iWidth = img.Width;
but, it display Height and Width in Pixels format.
In forum, they instructed as following:
for converting pixel to inch then, we have to do
(img.Height / img.VerticalResolution) * 25.4 = height in mm
(img.Width / img.HorizontalResolution) * 25.4 = width in mm
But, now the problem is,
if i use .net application - then, it showing 96 dpi of HorizontalResolution.if i open same image in illustrator - it showing 72 dpi of HorizontalResolution.
Now, what i have to do?
why there is a difference in Resolution for the same image in two different software?
suriya_wnm
Member
17 Points
59 Posts
Finding Image Size in C#.NET
Mar 05, 2009 02:57 AM|LINK
Hi all,
i want to find the Image Height and Width in cm/inch/mm format.
i used the following code:
Image img = Image.FromFile("image path");
double iHeight = img.Height;
double iWidth = img.Width;
but, it display Height and Width in Pixels format.
In forum, they instructed as following:
for converting pixel to inch then, we have to do
(img.Height / img.VerticalResolution) * 25.4 = height in mm
(img.Width / img.HorizontalResolution) * 25.4 = width in mm
But, now the problem is,
if i use .net application - then, it showing 96 dpi of HorizontalResolution.if i open same image in illustrator - it showing 72 dpi of HorizontalResolution.
Now, what i have to do?
why there is a difference in Resolution for the same image in two different software?
how to calculate image Height in inch.
pls, help me
Suriyanarayana.N
akmsaeea
Participant
1053 Points
205 Posts
Re: Finding Image Size in C#.NET
Sep 03, 2009 05:14 AM|LINK
Pls refer these links::
http://authors.aspalliance.com/brettb/ASPNETUploadImageSize.asp
http://www.dotnetspider.com/resources/7300-How-find-size-an-image.aspx
http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=234