Exemplo n.º 1
0
        private void LoadImage(string path)
        {
            var ori = ImageFileHelper.GetOrientationFromExif(path);

            var bitmap = new BitmapImage();

            using (var fs = File.OpenRead(path))
            {
                bitmap.BeginInit();
                bitmap.StreamSource = fs;
                bitmap.CacheOption  = BitmapCacheOption.OnLoad;
                bitmap.Rotation     = ori == ImageFileHelper.ExifOrientation.Rotate90CW
                    ? Rotation.Rotate90
                    : ori == ImageFileHelper.ExifOrientation.Rotate270CW
                        ? Rotation.Rotate270
                        : Rotation.Rotate0;
                bitmap.EndInit();
            }

            viewPanelImage.Source = bitmap;

            if (Path.GetExtension(path).ToLower() == ".gif")
            {
                AnimationBehavior.SetSourceUri(viewPanelImage, new Uri(path));
            }
        }
Exemplo n.º 2
0
        public void Prepare(string path, ContextObject context)
        {
            _imageSize = ImageFileHelper.GetImageSize(path) ?? Size.Empty;

            if (!_imageSize.IsEmpty)
            {
                context.SetPreferredSizeFit(_imageSize, 0.8);
            }
            else
            {
                context.PreferredSize = new Size(1024, 768);
            }

            Directory.SetCurrentDirectory(App.AppPath);
        }
Exemplo n.º 3
0
        public void Prepare(string path, ContextObject context)
        {
            _imageSize = ImageFileHelper.GetImageSize(path, _meta = new Meta(path));

            if (!_imageSize.IsEmpty)
            {
                context.SetPreferredSizeFit(_imageSize, 0.8);
            }
            else
            {
                context.PreferredSize = new Size(800, 600);
            }

            context.UseDarkTheme = true;
        }
Exemplo n.º 4
0
        public void Prepare(string path, ContextObject context)
        {
            _imageSize = ImageFileHelper.GetImageSize(path, _meta = new Meta(path));

            if (!_imageSize.IsEmpty)
            {
                context.SetPreferredSizeFit(_imageSize, 0.8);
            }
            else
            {
                context.PreferredSize = new Size(800, 600);
            }

            context.Theme = (Themes)SettingHelper.Get("LastTheme", 1);
        }
Exemplo n.º 5
0
        public void Prepare(string path, ContextObject context)
        {
            // set dcraw.exe for Magick.NET
            Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));

            _imageSize = ImageFileHelper.GetImageSize(path) ?? Size.Empty;

            if (!_imageSize.IsEmpty)
            {
                context.SetPreferredSizeFit(_imageSize, 0.8);
            }
            else
            {
                context.PreferredSize = new Size(1024, 768);
            }
        }
Exemplo n.º 6
0
        public void Prepare(string path, ContextObject context)
        {
            _imageSize = ImageFileHelper.GetImageSize(path) ?? Size.Empty;

            if (!_imageSize.IsEmpty)
            {
                context.SetPreferredSizeFit(_imageSize, 0.8);
            }
            else
            {
                context.PreferredSize = new Size(1024, 768);
            }

            Directory.SetCurrentDirectory(App.AppPath);

            context.TitlebarBlurVisibility = true;
            context.TitlebarOverlap        = true;
            context.TitlebarAutoHide       = true;
        }
Exemplo n.º 7
0
        public void BoundViewSize(string path, ContextObject context)
        {
            _imageSize = ImageFileHelper.GetImageSize(path);

            context.SetPreferredSizeFit(_imageSize, 0.8);
        }