Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You will need to read the <code>EXIF</code> data from the image. </p> <p>You can use <a href="http://www.codeproject.com/Articles/36342/ExifLib-A-Fast-Exif-Data-Extractor-for-NET-2-0" rel="nofollow">a library such as this</a></p> <pre><code>// Instantiate the reader ExifReader reader = new ExifReader(@"..path to your image\...jpg"); // Extract the tag data using the ExifTags enumeration double gpsLat, gpsLng; if (reader.GetTagValue&lt;double&gt;(ExifTags.GPSLatitude, out gpsLat)) { // Do whatever is required with the extracted information //... } if (reader.GetTagValue&lt;double&gt;(ExifTags.GPSLongitude, out gpsLng)) { // Do whatever is required with the extracted information //... } </code></pre> <p><strong>UPDATE.</strong> Code changed to use <code>MemoryStream</code></p> <pre><code> void cam_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { using (MemoryStream memo = new MemoryStream()) { e.ChosenPhoto.CopyTo(memo); memo.Position = 0; using (ExifReader reader = new ExifReader(memo)) { double[] latitudeComponents; reader.GetTagValue(ExifTags.GPSLatitude, out latitudeComponents); double[] longitudeComponents; reader.GetTagValue(ExifTags.GPSLongitude, out longitudeComponents); // Lat/long are stored as D°M'S" arrays, so you will need to reconstruct their values as below: var latitude = latitudeComponents[0] + latitudeComponents[1] / 60 + latitudeComponents[2] / 3600; var longitude = longitudeComponents[0] + longitudeComponents[1] / 60 + longitudeComponents[2] / 3600; // latitude and longitude should now be set correctly... } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload