How do I get the file size of an image?

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
 
S

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,100
Messages
2,570,635
Members
47,241
Latest member
HumbertoSt

Latest Threads

Top