Question : Get the file size of an image in a picturebox

Hi Experts,

I have a picture box on a windows form that displays a thumbnail image. When the user clicks on the image this opens a larger version on another windows form in a picturebox. I want to display to the user the picture info such as height, width, file name and path. These I can get without any problem by using the properties of the PictureBox1.Image properties. I also want to show the file size of the image in kilobytes or megabytes. I have tried calculating the height * width * 3 /1024 but this does not return the true image size. Can anyone tell me how to either return the image size from the picturebox properties or alternatively a calculation that will do that for me. Some images will be colour and others will be greyscale. jpg, tiff etc;

Regards,

Answer : Get the file size of an image in a picturebox

Random Solutions  
 
programming4us programming4us