[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

Getting image information witout loading the image itself

yosh

11/16/2004 10:38:00 AM

Can i get image information witout loading the image. since my images are quite big it takes a while
to load, and i just need to get the width, height and resolution of the image so i can calculate
the size in millimeters of the image with the formula: Math.Round(((25.4 * pixels) / resolution))

Thanks!
3 Answers

Bob Powell

11/16/2004 1:43:00 PM

0

All image formats have a strucured header from which you can read this type
of data. You could write code that read the headers in and decoded them,
I've done this several times in C++ but never in C# and unfortunately I
don't have access to any of that code.

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

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

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

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





<yosh@liquidzone.net> wrote in message
news:6NmdneoR1bc9RQTcRVnygw@giganews.com...
> Can i get image information witout loading the image. since my images are
quite big it takes a while
> to load, and i just need to get the width, height and resolution of the
image so i can calculate
> the size in millimeters of the image with the formula: Math.Round(((25.4 *
pixels) / resolution))
>
> Thanks!


Eran Kampf

11/16/2004 9:09:00 PM

0

Check out http://www.w... for file format structures....

--
Eran Kampf
http://www.ekamp...
http://www....


"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:%23mQwHJ%23yEHA.2804@TK2MSFTNGP15.phx.gbl...
> All image formats have a strucured header from which you can read this
> type
> of data. You could write code that read the headers in and decoded them,
> I've done this several times in C++ but never in C# and unfortunately I
> don't have access to any of that code.
>
> --
> Bob Powell [MVP]
> Visual C#, System.Drawing
>
> Find great Windows Forms articles in Windows Forms Tips and Tricks
> http://www.bobpowell.net/tips...
>
> Answer those GDI+ questions with the GDI+ FAQ
> http://www.bobpowell.net/f...
>
> All new articles provide code in C# and VB.NET.
> Subscribe to the RSS feeds provided and never miss a new article.
>
>
>
>
>
> <yosh@liquidzone.net> wrote in message
> news:6NmdneoR1bc9RQTcRVnygw@giganews.com...
>> Can i get image information witout loading the image. since my images are
> quite big it takes a while
>> to load, and i just need to get the width, height and resolution of the
> image so i can calculate
>> the size in millimeters of the image with the formula: Math.Round(((25.4
>> *
> pixels) / resolution))
>>
>> Thanks!
>
>


yosh

11/16/2004 10:07:00 PM

0

Thanks, ill look into that see what i can come up with.


> Check out http://www.w... for file format structures....
>
> --
> Eran Kampf
> http://www.ekamp...
> http://www....
>
>
> "Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
> news:%23mQwHJ%23yEHA.2804@TK2MSFTNGP15.phx.gbl...
> > All image formats have a strucured header from which you can read this
> > type
> > of data. You could write code that read the headers in and decoded them,
> > I've done this several times in C++ but never in C# and unfortunately I
> > don't have access to any of that code.
> >
> > --
> > Bob Powell [MVP]
> > Visual C#, System.Drawing
> >
> > Find great Windows Forms articles in Windows Forms Tips and Tricks
> > http://www.bobpowell.net/tips...
> >
> > Answer those GDI+ questions with the GDI+ FAQ
> > http://www.bobpowell.net/f...
> >
> > All new articles provide code in C# and VB.NET.
> > Subscribe to the RSS feeds provided and never miss a new article.
> >
> >
> >
> >
> >
> > <yosh@liquidzone.net> wrote in message
> > news:6NmdneoR1bc9RQTcRVnygw@giganews.com...
> >> Can i get image information witout loading the image. since my images are
> > quite big it takes a while
> >> to load, and i just need to get the width, height and resolution of the
> > image so i can calculate
> >> the size in millimeters of the image with the formula: Math.Round(((25.4
> >> *
> > pixels) / resolution))
> >>
> >> Thanks!
> >
> >
>
>
>