private void jpegListView_DoubleClick(object sender, EventArgs e) { ListView lv = sender as ListView; ListViewItem item = lv.SelectedItems[0]; JPEGFileItem jpegItem = item.Tag as JPEGFileItem; PreViewForm pv = new PreViewForm(jpegItem); pv.ShowDialog(this); }
private void LoadJpeg(string filePath) { JPEGFileItem item = new JPEGFileItem(filePath); _jpgFile.Add(item); foreach (GPXFileItem gpx in _gpxFile) { DateTime a = item.DateTimeOriginal; if (gpx.StartTime <= a && a <= gpx.EndTime) { foreach (TrackPointItem trkpt in gpx.Items) { if (trkpt.Time == item.DateTimeOriginal) { if (0 == string.Compare(trkpt.LatMark, "N", true)) { item.NewLocation.LatitudeRef = GPSLocation.LatitudeFlag.NORTH; } else if (0 == string.Compare(trkpt.LatMark, "S", true)) { item.NewLocation.LatitudeRef = GPSLocation.LatitudeFlag.SOUTH; } item.NewLocation.LatitudeRaw = trkpt.LatArray(); item.NewLocation.LongitudeRaw = trkpt.LonArray(); break; } } break; } } ListViewItem listItem = new ListViewItem(System.IO.Path.GetFileName(item.FilePath)); listItem.SubItems.Add(item.DateTimeOriginal.ToString()); listItem.SubItems.Add(item.CurrentLocation.ToString()); if (item.NewLocation.HasLocation()) { listItem.SubItems.Add(item.NewLocation.ToString()); } else { listItem.SubItems.Add(string.Empty); } listItem.Tag = item; jpegListView.Items.Add(listItem); }
private void LoadJpeg( string filePath) { JPEGFileItem item = new JPEGFileItem(filePath); _jpgFile.Add(item); foreach(GPXFileItem gpx in _gpxFile) { DateTime a = item.DateTimeOriginal; if ( gpx.StartTime <= a && a <= gpx.EndTime) { foreach( TrackPointItem trkpt in gpx.Items) { if( trkpt.Time == item.DateTimeOriginal) { if( 0 == string.Compare(trkpt.LatMark, "N", true)) { item.NewLocation.LatitudeRef = GPSLocation.LatitudeFlag.NORTH; } else if (0 == string.Compare(trkpt.LatMark, "S", true)) { item.NewLocation.LatitudeRef = GPSLocation.LatitudeFlag.SOUTH; } item.NewLocation.LatitudeRaw = trkpt.LatArray(); item.NewLocation.LongitudeRaw = trkpt.LonArray(); break; } } break; } } ListViewItem listItem = new ListViewItem( System.IO.Path.GetFileName( item.FilePath)); listItem.SubItems.Add(item.DateTimeOriginal.ToString()); listItem.SubItems.Add(item.CurrentLocation.ToString()); if (item.NewLocation.HasLocation()) { listItem.SubItems.Add(item.NewLocation.ToString()); } else { listItem.SubItems.Add(string.Empty); } listItem.Tag = item; jpegListView.Items.Add(listItem); }
public PreViewForm(JPEGFileItem fileItem) { InitializeComponent(); _fileItem = fileItem; }