Solved

Getting the image and path from a picturebox?

Posted on 2004-09-19
2
282 Views
Last Modified: 2010-04-15
I was wondering if it's possible to pull the image and the path out of a picturebox.  Basically, I have a picturebox in my C# windows app called astrologyPic.  Is there some way to get the filename out of this using code?  For example, can I call a function like astrologyPic.image.Filename and have it return C:\Images\imagename.jpg?  Any help on this would be greatly appreciated.
0
Comment
Question by:DragXSlay
2 Comments
 
LVL 10

Accepted Solution

by:
eternal_21 earned 50 total points
ID: 12099001
No, there is no way to do this.  The PictureBox control is independant of the file system, and loads a System.Drawing.Image object without any prerequisite for source (i.e.: Image can be from file, memory, or network, etc.).  If your PictureBox is being loaded with an image from the hard drive, I suggest your save the file name in a variable, and then you may refer to this later.
0
 
LVL 7

Expert Comment

by:5thcav
ID: 14333955
old question?

why not set the picturebox1.Tag =("filename and path..") then simply pull it out?
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now