How to read jpeg dimensions?

spider-blues
08-12-2004, 01:14 PM
Hi,

I have a little problem: I need a small command line program, which reads the image dimensions (filename given as parameter), and write this to a textfile.

Is this possible with VB.NET? :confused:

I've installed VB.NET in the company, but never developed with vb!
Does anybody have some examples how to do something like that?

Thanks

Peter

Iceplug
08-12-2004, 04:14 PM
You can declare a Bitmap and load the image into it.
Dim Bmp As Bitmap = Bitmap.FromFile(pathtojpeg)
And yes, you can load a JPG into a Bitmap.
To get the height and width, use Bmp.Height and Bmp.Width.
:)

spider-blues
08-13-2004, 03:08 PM
thanks, but I'm afraid, I couldn't do that without learning more about vb???

Buying a Book now...

Iceplug
08-13-2004, 03:14 PM
Well, have fun reading. Hopefully you'll eventually be able to figure out how to work that into the rest of your program which determines how you should set it up, but the code should be similar to what I mentioned above.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum