GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / GetLastPath Method
Example





In This Topic
GetLastPath Method (GdViewer)
In This Topic
Returns the file path of the latest loaded or saved file using this GdViewer control. The stored value is not erased after closing the file. It is only overwritten with each new file loading or saving operation.

Be aware that both AddEmbeddedImageAnnotInteractive(String,Boolean,Color,Single,Single) and %AddEmbeddedImageAnnotInteractive(string, bool, int, float, float)% methods overwrite the last used path with their ImagePath parameter.

Syntax
'Declaration
 
Public Function GetLastPath() As String
public string GetLastPath()
public function GetLastPath(): String; 
public function GetLastPath() : String;
public: string* GetLastPath(); 
public:
String^ GetLastPath(); 

Return Value

The file path of the latest loaded or saved file.
Remarks
Please note that the value of this attribute is not erased after the file is closed.

Be aware that this attribut is overwritten using both AddEmbeddedImageAnnotInteractive(String,Boolean,Color,Single,Single) and %AddEmbeddedImageAnnotInteractive(string, bool, int, float, float)% methods.

Example
How to retrieve the file path of the latest loaded file.
'We assume that the GdViewer1 control has been properly integrated.
Dim status As GdPictureStatus = GdViewer1.DisplayFromFile("")
If status = GdPictureStatus.OK Then
    MessageBox.Show("The loaded file path is: " + GdViewer1.GetLastPath(), "GdViewer.GetLastPath")
Else
    MessageBox.Show("The file can't be loaded. Status: " + status.ToString(), "GdViewer.GetLastPath")
End If
//We assume that the GdViewer1 control has been properly integrated.
GdPictureStatus status = GdViewer1.DisplayFromFile("");
if (status == GdPictureStatus.OK)
    MessageBox.Show("The loaded file path is: " + GdViewer1.GetLastPath(), "GdViewer.GetLastPath");
else
    MessageBox.Show("The file can't be loaded. Status: " + status.ToString(), "GdViewer.GetLastPath");
See Also