|
-
Mar 31st, 2006, 09:23 AM
#1
Thread Starter
Fanatic Member
Find file type from picturebox
Is there any way of finding out what type an image is when embedded in a picturebox.
For example, if someone loaded "C:\mypicture.jpg" into a picturebox then how can I find out if the image is jpg or bmp without knowing the source ?
-
Mar 31st, 2006, 11:25 AM
#2
Re: Find file type from picturebox
You can't
Once it's in the picturebox it has lost all information of where it came from.
-
Mar 31st, 2006, 11:37 AM
#3
Re: Find file type from picturebox
If you populate a .NET 2.0 PictureBox by calling the Load method or by setting the ImageLocation property then the original file path will be accessible via the ImageLocation property. This beats using Image.FromFile as it doesn''t lock the file either.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|