PC Review


Reply
Thread Tools Rate Thread

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

 
 
=?Utf-8?B?QnJpYW4gS2l0dA==?=
Guest
Posts: n/a
 
      21st May 2005
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.
 
Reply With Quote
 
 
 
 
Morten Wennevik
Guest
Posts: n/a
 
      21st May 2005
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.

On Sat, 21 May 2005 00:55:08 +0200, Brian Kitt"" <(E-Mail Removed)> wrote:

> 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.
>




--
Happy coding!
Morten Wennevik [C# MVP]
 
Reply With Quote
 
Lloyd Dupont
Guest
Posts: n/a
 
      21st May 2005
look at this sample application
http://www.windowsforms.net/Applicat...=50&tabindex=8

they modify image's header

"Brian Kitt" <(E-Mail Removed)> wrote in message
news:5A2859D6-2960-48CF-B2B1-(E-Mail Removed)...
>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.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drawing on jpeg photographs jack.smith@stress.com Microsoft Word Document Management 2 12th Mar 2010 07:32 AM
Mirror / rotate image ( System.Drawing.Graphics / System.Drawing.Drawing2D.Matrix) Eduard Witteveen Microsoft C# .NET 3 17th Jul 2006 02:26 PM
Reducing/Scaling text, JPEG and drawing shapes =?Utf-8?B?RWFybA==?= Microsoft Word Document Management 0 30th Nov 2005 10:46 PM
Text orientation become vertical when drawing on JPEG image Julia Microsoft C# .NET 1 2nd Jan 2005 04:09 PM
Drawing column headers... =?Utf-8?B?WWFyb24=?= Microsoft C# .NET 3 10th Mar 2004 03:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:40 PM.