Exemplo n.º 1
0
        private void UpdateView()
        {
            btnEmbed.Enabled = (data != null) && (data.Format != ImageFileFormat.Unknown);
            btnSave.Enabled  = (data != null) && (data.Format != ImageFileFormat.Unknown);
            lvExif.Items.Clear();
            foreach (ExifProperty item in data.Properties)
            {
                ListViewItem lvitem = new ListViewItem(item.Name);
                lvitem.SubItems.Add(item.ToString());
                lvitem.SubItems.Add(Enum.GetName(typeof(IFD), ExifTagFactory.GetTagIFD(item.Tag)));
                lvitem.Tag = item;
                lvExif.Items.Add(lvitem);
            }
            if (data.Thumbnail == null)
            {
                pbThumb.Image = null;
            }
            else
            {
                pbThumb.Image = data.Thumbnail.ToImage();
            }
            pbOrigin.Image = data.ToImage();

            lblThumbnail.Text     = "Thumbnail: " + (data.Thumbnail == null ? "None" : data.Thumbnail.ToImage().Width.ToString() + "x" + data.Thumbnail.ToImage().Height.ToString());
            pgExif.SelectedObject = data;

            lvExif.Sort();
        }
Exemplo n.º 2
0
        private void UpdateView()
        {
            btnEmbed.Enabled = (data != null) && (data.Format != ImageFileFormat.Unknown);
            btnSave.Enabled  = (data != null) && (data.Format != ImageFileFormat.Unknown);
            lvExif.Items.Clear();
            foreach (ExifProperty item in data.Properties)
            {
                ListViewItem lvitem = new ListViewItem(item.Name);
                lvitem.SubItems.Add(item.ToString());
                lvitem.SubItems.Add(Enum.GetName(typeof(IFD), ExifTagFactory.GetTagIFD(item.Tag)));
                lvitem.Tag = item;
                lvExif.Items.Add(lvitem);
            }
            if (data.Thumbnail == null)
            {
                pbThumb.Image = null;
            }
            else
            {
                try
                {
                    pbThumb.Image = ImageFile.FromStream(new MemoryStream(data.Thumbnail)).ToImage();
                }
                catch (Exception)
                {
                    // Bummer
                    pbThumb.Image = null;
                }
            }
            pbOrigin.Image = data.ToImage();

            if (data.Thumbnail == null)
            {
                lblThumbnail.Text = "Thumbnail: None";
            }
            else if (pbThumb.Image == null)
            {
                lblThumbnail.Text = "Thumbnail: Unreadable";
            }
            else
            {
                lblThumbnail.Text = "Thumbnail: " + pbThumb.Image.Width.ToString() + "x" + pbThumb.Image.Height.ToString();
            }

            pgExif.SelectedObject = data;

            lvExif.Sort();
        }
Exemplo n.º 3
0
 public ExifProperty(ExifTag tag)
 {
     mTag = tag;
     mIFD = ExifTagFactory.GetTagIFD(tag);
 }
Exemplo n.º 4
0
        private void UpdateView()
        {
            btnEmbed.Enabled = (data != null) && (data.Format != ImageFileFormat.Unknown);
            btnSave.Enabled  = (data != null) && (data.Format != ImageFileFormat.Unknown);
            lvExif.Items.Clear();
            foreach (ExifProperty item in data.Properties)
            {
                ListViewItem lvitem = new ListViewItem(item.Name);
                lvitem.SubItems.Add(item.ToString());
                lvitem.SubItems.Add(Enum.GetName(typeof(IFD), ExifTagFactory.GetTagIFD(item.Tag)));
                lvitem.Tag = item;
                lvExif.Items.Add(lvitem);
            }
            if (data.Thumbnail == null)
            {
                pbThumb.Image = null;
            }
            else
            {
                try
                {
                    pbThumb.Image = ImageFile.FromStream(new MemoryStream(data.Thumbnail)).ToImage();
                }
                catch (Exception)
                {
                    pbThumb.Image = null;
                }
            }
            pbOrigin.Image = data.ToImage();

            if (data.Thumbnail == null)
            {
                lblThumbnail.Text = "Thumbnail: None";
            }
            else if (pbThumb.Image == null)
            {
                lblThumbnail.Text = "Thumbnail: Unreadable";
            }
            else
            {
                lblThumbnail.Text = "Thumbnail: " + pbThumb.Image.Width.ToString() + "x" + pbThumb.Image.Height.ToString();
            }

            pgExif.SelectedObject = data;

            lvExif.Sort();

            txtErrors.Text = "";
            foreach (var err in data.Errors)
            {
                txtErrors.Text += err.Message + Environment.NewLine;
            }


            if (imageFilename == null)
            {
                Text           = "Exif Test";
                lblStatus.Text = "Ready";
            }
            else
            {
                Text           = Path.GetFileName(imageFilename) + " - Exif Test";
                lblStatus.Text = Path.GetFileName(imageFilename);
            }
        }