MPIon
Well-known member
I am trying to retrieve the GPS Coordinates from a jpg file using c# in a Windows Forms application.
I can retrieve the Latitude Direction for example using :-
which typically returns "N".
Can't seem to find the correct syntax to return the Latitude value though using something like :-
Compile error is
Cannot implicitly convert type 'Microsoft.WindowsAPICodePack.Shell.PropertySystem.IShellProperty' to 'double[]'
This despite the documentation saying the Property is a double array.
Have extensively searched the Internet to no avail. No one seems to have a simple example of retrieving this property. (Something I can do easily in VBA using WIA.ImageFile).
I can retrieve the Latitude Direction for example using :-
C#:
ShellFile.FromParsingName(fullPath).Properties.GetProperty(GPS.LatitudeRef).ValueAsObject?.ToString() ?? "";
Can't seem to find the correct syntax to return the Latitude value though using something like :-
C#:
double[] xx;
xx = ShellFile.FromParsingName(fullPath).Properties.GetProperty(GPS.Latitude)
Compile error is
Cannot implicitly convert type 'Microsoft.WindowsAPICodePack.Shell.PropertySystem.IShellProperty' to 'double[]'
This despite the documentation saying the Property is a double array.
Have extensively searched the Internet to no avail. No one seems to have a simple example of retrieving this property. (Something I can do easily in VBA using WIA.ImageFile).