How to get file name of after DisplayFromFile("")
How to get file name of after DisplayFromFile("")
If I use GdViewer.DisplayFromFile(""), how can my program learn the filename the user selected? There appears to be no property within GdViewer for file name.
Thanks,
Randy
Thanks,
Randy
Re: How to get file name of after DisplayFromFile("")
Hi Randy,
Sorry for the delay. Currently there is no way to get file path used to open a document. I've added the feature on our whish-list.
Kind regards,
Loïc
Sorry for the delay. Currently there is no way to get file path used to open a document. I've added the feature on our whish-list.
Kind regards,
Loïc
Re: How to get file name of after DisplayFromFile("")
Don't worry. I used the generic file dialog instead.
Re: How to get file name of after DisplayFromFile("")
Hi Loïc,
is it foreseeable when this feature will be available ?
So it would be very nice to get the filename after i use the DisplayFromFile-Method.
Kind Regards
Frank Scheer
is it foreseeable when this feature will be available ?
So it would be very nice to get the filename after i use the DisplayFromFile-Method.
Kind Regards
Frank Scheer
-
- Posts: 352
- Joined: Tue Sep 27, 2011 11:47 am
Re: How to get file name of after DisplayFromFile("")
Hi,
Unfortunately we have not implemented it yet, but here is what you can do:
Go to our demo c#/ImageProcessing, and in the Open Routine there is such an implementation, to make things easier:
Hope this helps.
Best Regards,
Sami Kharma
GdPicture Support Team Member
Unfortunately we have not implemented it yet, but here is what you can do:
Go to our demo c#/ImageProcessing, and in the Open Routine there is such an implementation, to make things easier:
Code: Select all
string file;
String Name;
int m_CurrentImage;
GdPictureImaging Imaging = new GdPictureImaging();
DialogResult result = MainFormReference.openFileDialog1.ShowDialog(); // Show the dialog.
if (result == DialogResult.OK) // Test result.
{
file = MainFormReference.openFileDialog1.FileName;
try
{
m_CurrentImage = Imaging.CreateGdPictureImageFromFile(file);
if (m_CurrentImage == 0)
{
Name = Path.GetFileName(file);
}
}
catch (IOException)
{
}
}
Hope this helps.
Best Regards,
Sami Kharma
GdPicture Support Team Member
-
- Posts: 32
- Joined: Wed Jul 18, 2007 11:58 pm
Re: How to get file name of after DisplayFromFile("")
I figured out a better way to return the file path of the current image.
When displaying an image, save the file path to the .tag property of the image viewer:
GDImgCtrl.Tag = FileLocation
When you want to figure out what the current file path is use the code:
If GDImgCtrl.PageCount > 0 then currentfilename = GDImgCtrl.Tag
When displaying an image, save the file path to the .tag property of the image viewer:
GDImgCtrl.Tag = FileLocation
When you want to figure out what the current file path is use the code:
If GDImgCtrl.PageCount > 0 then currentfilename = GDImgCtrl.Tag
Re: How to get file name of after DisplayFromFile("")
There is now an internal function for such purpose.
From the reference guide:
From the reference guide:
You can subsequently use the GetLastPath() function to retrieve the path of the selected file.
Who is online
Users browsing this forum: No registered users and 1 guest