Solved

Getting the image and path from a picturebox?

Posted on 2004-09-19
2
320 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

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