How do I get the file size of an image?

  • Thread starter Thread starter Stu
  • Start date Start date
S

Stu

Hi,

I have opened an image using the code below. I can read the physical
dimesions of the image but I need to get the file size.

Dim img As System.Drawing.Image
img = System.Drawing.Image.FromFile("C:\MyImage.jpg")

I need to do it without looking at the file system as I am going to be doing
some basic compression on the fly, and allowing the user to select the one
with the lowest file size that looks OK.

Thanks in advance.

Stu
 
Hi,

The idea is that I want to display a list of 6 or so images with differing
levels of compression. I then want the user to select the one with the
lowest file size that is good enough quality. I could write all the files to
a temp folder on the hard drive and then just point to those but I would
rather do it in memory.

Is there any way to count the number of bits/bytes in an image object?
If it HAS to be done using the file system...how do you do it?

Thanks in advance,

Stu
 
Back
Top