Exemplo n.º 1
0
        protected override void OnPageLoad()
        {
            base.OnPageLoad();

            if (string.IsNullOrEmpty(_currentPicture) || !File.Exists(_currentPicture))
            {
                ReturnToPreviousWindow();
                return;
            }

            _currentMetaData = PictureDatabase.GetExifFromDB(_currentPicture);
            if (_currentMetaData.IsEmpty())
            {
                _currentMetaData = PictureDatabase.GetExifFromFile(_currentPicture);
            }
            if (_currentMetaData.IsEmpty())
            {
                ReturnToPreviousWindow();
                return;
            }

            GUIPropertyManager.SetProperty("#pictures.exif.images.vertical", string.Empty);
            GUIPropertyManager.SetProperty("#pictures.exif.images.horizontal", string.Empty);

            SetExifGUIListItems();
            Update();
            Refresh();
        }
Exemplo n.º 2
0
        private void Update()
        {
            if (m_pTexture != null)
            {
                m_pTexture.Dispose();
            }

            SetLabel(lblCameraModel, string.Empty);
            SetLabel(lblDateTakenLabel, string.Empty);
            SetLabel(lblEquipmentMake, string.Empty);
            SetLabel(lblExposureCompensation, string.Empty);
            SetLabel(lblExposureTime, string.Empty);
            SetLabel(lblFlash, string.Empty);
            SetLabel(lblFstop, string.Empty);
            SetLabel(lblImgDimensions, string.Empty);
            SetLabel(lblImgTitle, string.Empty);
            SetLabel(lblMeteringMode, string.Empty);
            SetLabel(lblResolutions, string.Empty);
            SetLabel(lblShutterSpeed, string.Empty);
            SetLabel(lblViewComments, string.Empty);

            if (!File.Exists(FileName))
            {
                GUIPropertyManager.SetProperty("#selectedthumb", string.Empty);
                return;
            }

            int iRotate = PictureDatabase.GetRotation(FileName);

            m_pTexture = Util.Picture.Load(FileName, iRotate, (int)Thumbs.LargeThumbSize.uhd, (int)Thumbs.LargeThumbSize.uhd,
                                           true, false, out m_iTextureWidth, out m_iTextureHeight);

            ExifMetadata.Metadata metaData = PictureDatabase.GetExifFromDB(FileName);
            if (metaData.IsEmpty())
            {
                metaData = PictureDatabase.GetExifFromFile(FileName);
            }
            if (!metaData.IsEmpty())
            {
                SetLabel(lblCameraModel, metaData.CameraModel.DisplayValue);
                SetLabel(lblDateTakenLabel, metaData.DatePictureTaken.DisplayValue);
                SetLabel(lblEquipmentMake, metaData.EquipmentMake.DisplayValue);
                SetLabel(lblExposureCompensation, metaData.ExposureCompensation.DisplayValue);
                SetLabel(lblExposureTime, metaData.ExposureTime.DisplayValue);
                SetLabel(lblFlash, metaData.Flash.DisplayValue, true);
                SetLabel(lblFstop, metaData.Fstop.DisplayValue);
                SetLabel(lblImgDimensions, metaData.ImageDimensionsAsString());
                SetLabel(lblImgTitle, Path.GetFileNameWithoutExtension(FileName));
                SetLabel(lblMeteringMode, metaData.MeteringMode.DisplayValue, true);
                SetLabel(lblResolutions, metaData.ResolutionAsString());
                SetLabel(lblShutterSpeed, metaData.ShutterSpeed.DisplayValue);
                SetLabel(lblViewComments, metaData.ViewerComments.DisplayValue);

                imgPicture.IsVisible = false;
            }
            metaData.SetExifProperties();
            GUIPropertyManager.SetProperty("#selectedthumb", FileName);
        }