Example #1
0
        //以前
        //02_090702150918-0001.jpg -->大图片
        //02_090702152518-0006-0000.jpg--> 小图片

        //现在
        //02_090807144104343.jpg-->大图片
        //02_090807144104343-0000.jpg-->小图片
        private void bestPicListView_ItemActivate(object sender, System.EventArgs e)
        {
            string filePath = this.bestPicListView.FocusedItem.Tag as string;

            //show modify icon
            if (File.Exists(filePath))
            {
                this.pictureBox1.Image = Image.FromFile(filePath);
            }

            //detail infomation
            ImageDetail imgInfo = ImageDetail.FromPath(filePath);

            string captureLoc = string.Format("抓拍地点: {0}", imgInfo.FromCamera);

            this.labelCaptureLoc.Text = captureLoc;

            string captureTime = string.Format("抓拍时间: {0}", imgInfo.CaptureTime);

            this.labelCaptureTime.Text = captureTime;

            string bigImgPath = FileSystemStorage.BigImgPathForFace(imgInfo);

            this.pictureBoxWholeImg.Image = Image.FromFile(bigImgPath);
        }
Example #2
0
        private void SaveSelectedImage()
        {
            if ((this.bestPicListView.Items.Count <= 0) || (this.bestPicListView.FocusedItem == null))
            {
                return;
            }
            string filePath = this.bestPicListView.FocusedItem.Tag as string;

            if (File.Exists(filePath))
            {
                this.pictureBox1.Image = Image.FromFile(filePath);
            }
            ImageDetail imgInfo    = ImageDetail.FromPath(filePath);
            string      bigImgPath = FileSystemStorage.BigImgPathForFace(imgInfo);

            using (SaveFileDialog saveDialog = new SaveFileDialog())
            {
                saveDialog.RestoreDirectory = true;
                saveDialog.Filter           = "Jpeg 文件|*.jpg";
                //saveDialog.FileName = filePath.Substring(filePath.Length - 27, 27);
                string fileName = Path.GetFileName(filePath);
                saveDialog.FileName = fileName;
                if (saveDialog.ShowDialog() == DialogResult.OK)
                {
                    if (pictureBox1.Image != null)
                    {
                        string path = saveDialog.FileName;
                        pictureBox1.Image.Save(path);
                        path = path.Replace(fileName, Path.GetFileName(bigImgPath));
                        pictureBoxWholeImg.Image.Save(path);
                    }
                }
            }
        }
        public void SelectedImageChanged()
        {
            ImageDetail img = this.screen.SelectedImage;

            if (img != null && !string.IsNullOrEmpty(img.Path))
            {
                string      bigPicPathName = FileSystemStorage.BigImgPathForFace(img);
                ImageDetail bigImageDetail = ImageDetail.FromPath(bigPicPathName);
                this.screen.BigImage = bigImageDetail;
            }
        }
Example #4
0
        public ImagePair GetFace(string path)
        {
            Bitmap face = (Bitmap)Image.FromFile(path);

            string bigImgPath = FileSystemStorage.BigImgPathForFace(Core.ImageDetail.FromPath(path));

            Bitmap big = (Bitmap)Image.FromFile(bigImgPath);

            ImagePair ip = new ImagePair();

            ip.Face     = face;
            ip.FacePath = path;

            ip.BigImage     = big;
            ip.BigImagePath = bigImgPath;

            return(ip);
        }