Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2005

Tip: Looking for answers? Try searching our database.

How do you use System.Drawing for reading .jpeg or .gif headers?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brian Kitt - 20 May 2005 23:54 GMT
I need to read the header information on an image (could be a .jpeg, .gif,
.bmp) and find the height and width.  I know I can open it as a binary file,
and bump to the appropriate location where height and width is stored in the
header, but I was wondering if anyone knows of a slick way of using
System.Drawing utilities to do this?
Thanks for any help you can give me.
Morten Wennevik - 21 May 2005 00:52 GMT
Brian,

If you load it as a Bitmap (Image.FromFile) you can read the Bitmap dimensions afterwards.  Otherwise you will have to read the headers by hand and decode the files yourself.

> I need to read the header information on an image (could be a .jpeg, .gif,
> .bmp) and find the height and width.  I know I can open it as a binary file,
> and bump to the appropriate location where height and width is stored in the
> header, but I was wondering if anyone knows of a slick way of using
> System.Drawing utilities to do this?
> Thanks for any help you can give me.

Signature

Happy coding!
Morten Wennevik [C# MVP]

Lloyd Dupont - 21 May 2005 01:37 GMT
look at this sample application
http://www.windowsforms.net/Applications/application.aspx?PageID=50&tabindex=8

they modify image's header

>I need to read the header information on an image (could be a .jpeg, .gif,
> .bmp) and find the height and width.  I know I can open it as a binary
[quoted text clipped - 4 lines]
> System.Drawing utilities to do this?
> Thanks for any help you can give me.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.