protected void ResetPhoto() { lock (this) { if (CurrentPhotoTexture != null) { CurrentPhotoTexture.Dispose(); CurrentPhotoTexture = null; } CurrentPhoto = null; CurrentPhotoRectangle = default(Rectangle); } }
public PhotoIndex(Photo p) { Time = p.Time; Boats = p.Boats; }
public static Dictionary<PhotoIndex, Photo> FindInDateRange(DateTime start, DateTime end) { var query = from r in Persistance.Data.Photo.AsEnumerable() where r.time > start && r.time < end orderby r.time ascending select r; Dictionary<PhotoIndex, Photo> photos = new Dictionary<PhotoIndex, Photo>(); foreach (SkipperDataSet.PhotoRow rr in query) { Photo p = new Photo(rr); photos.Add(new PhotoIndex(p), p); } return photos; }
private void ReadExif(string path,Photo p) { FileStream fs=null; //try //{ // fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read); // System.Windows.Media.Imaging.BitmapSource img = System.Windows.Media.Imaging.BitmapFrame.Create(fs); // System.Windows.Media.Imaging.BitmapMetadata meta = (System.Windows.Media.Imaging.BitmapMetadata)img.Metadata; // try // { // p.Caption = meta.Title + " " + meta.Subject + " " + meta.Comment; // } // catch // { // p.Caption = ""; // } // try // { // p.Time = DateTime.Parse(meta.DateTaken); // } // catch // { // FileInfo fi = new FileInfo(path); // p.Time = fi.LastWriteTime; // } // fs.Close(); //} //catch //{ if (fs != null) { try { fs.Close(); } catch { } } p.Caption = ""; FileInfo fi = new FileInfo(path); p.Time = fi.LastWriteTime; //} }
private void LoadFileInfo(FileInfo[] files) { //BusyDialogManager.Show("Importing and resizing pictures",this); foreach (FileInfo f in files) { BusyDialogManager.Show("Importing and resizing " + f.Name); Photo p = new Photo(); p.Name = f.Name; //TimeZoneInfo tzi = _lake.TimeZone; //p.Time = TimeZoneInfo.ConvertTimeToUtc(f.LastWriteTime, tzi); ReadExif(f.FullName,p); p.Jpg = ConvertAndResize(f.FullName, 640, 480); p.Save(); } LoadPhotos(); BusyDialogManager.Hide(); }