Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help getting the path/filename from an image

Status
Not open for further replies.

FireFett

Programmer
Mar 31, 2000
42
US
I have been digging in the Image object and haven't found a property or method to extract the path/filename out of the object only the setting it via image.fromfile.

Currently I have an app that has a property grid that has an image type defined and the users can select the image they want. But I need to store the path & filename. Thus far its the only way I can find to use a browse dialog via the property grid if anyone has another way to do this it would be greatly appreciated.

 
I don't think the Image class has a filename, it only has the image. You could create a new class like so though:

Code:
public class FileImage Inherits Image

private m_FileName as string = string.empty
private m_FilePath as string = string.empty

public property FileName as string
  Get
    Return m_FileName 
  End Get
  Set(ByVal Value As String)
    m_FileName = Value
  End Set
end property

public property FilePath as string
  Get
    Return m_FilePath
  End Get
  Set(ByVal Value As String)
    m_FilePath = Value
  End Set
end property

end class

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top