IT Community - Software Programming, Web Development and Technical Support

How to get dimensions of the image in C# DOT NET 2005?

This is a discussion on How to get dimensions of the image in C# DOT NET 2005? within the C# Programming forums, part of the Software Development category; How to get dimensions of the image in C# DOT NET 2005?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-25-2007, 03:27 AM
Archer Archer is offline
D-Web Programmer
 
Join Date: Jun 2007
Posts: 52
Archer is on a distinguished road
Question How to get dimensions of the image in C# DOT NET 2005?

How to get dimensions of the image in C# DOT NET 2005?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-25-2007, 03:28 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default Re: How to get dimensions of the image in C# DOT NET 2005?

Hi Archer...

Using the below code, one can easily get the dimensions of the image from a specified path.

FileStream fs = new FileStream (path, FileMode.Open, FileAccess.Read, FileShare.Read);

using (System.Drawing.Image image =
System.Drawing.Image.FromStream (fs))
{
int fileLength = Convert.ToInt32 (fs.Length);
fileWidth = image.Width;
fileHeight = image.Height;
}
fs.Close();
fs = null;
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Server 2005 kingmaker Database Support 100 03-22-2008 02:08 AM
Convert image to other image format using CODEC in .NET 3.0 Mramesh C# Programming 0 02-07-2008 03:33 AM
How to create an image from panel background Image S.Vinothkumar C# Programming 1 10-22-2007 03:52 AM
Threading in C# .Net 2005 : a.deeban C# Programming 53 09-10-2007 07:27 AM
I Cannot access SQL 2005 integrated services after installing SQL-2005..? theone Database Support 1 07-27-2007 01:12 AM


All times are GMT -7. The time now is 11:01 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0