Esempio n. 1
0
        /// <summary>
        /// Load a picture from a prepared bitmap
        /// </summary>
        /// <param name="pic"></param>
        /// <param name="imageName"></param>
        internal static void Pic(BitmapSource bitmap, string imageName)
        {
            /// Old method, might need updates?

            Unload();

            if (IsScrollEnabled)
            {
                LoadWindows.GetMainWindow.Scroller.ScrollToTop();
            }

            LoadWindows.GetMainWindow.MainImage.Source = bitmap;

            FitImage(bitmap.PixelWidth, bitmap.PixelHeight);
            CloseToolTipMessage();

            SetTitleString(bitmap.PixelWidth, bitmap.PixelHeight, imageName);

            Taskbar.NoProgress();

            CanNavigate = false;
            FolderIndex = 0;

            if (LoadWindows.GetImageInfoWindow != null)
            {
                if (LoadWindows.GetImageInfoWindow.IsVisible)
                {
                    LoadWindows.GetImageInfoWindow.UpdateValues();
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Load a picture from a base64
        /// </summary>
        /// <param name="pic"></param>
        /// <param name="imageName"></param>
        internal static async void Pic64(string base64string)
        {
            var pic = await Base64.Base64StringToBitmap(base64string).ConfigureAwait(true);

            Unload();

            if (IsScrollEnabled)
            {
                LoadWindows.GetMainWindow.Scroller.ScrollToTop();
            }

            LoadWindows.GetMainWindow.MainImage.Source = pic;

            FitImage(pic.PixelWidth, pic.PixelHeight);
            CloseToolTipMessage();

            SetTitleString(pic.PixelWidth, pic.PixelHeight, Application.Current.Resources["Base64Image"] as string);

            Taskbar.NoProgress();

            CanNavigate = false;

            if (LoadWindows.GetImageInfoWindow != null)
            {
                if (LoadWindows.GetImageInfoWindow.IsVisible)
                {
                    LoadWindows.GetImageInfoWindow.UpdateValues();
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Load a picture from a base64
        /// </summary>
        /// <param name="pic"></param>
        /// <param name="imageName"></param>
        internal static async void Pic64(string base64string)
        {
            var pic = await Base64.Base64StringToBitmap(base64string).ConfigureAwait(false);

            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)(() =>
            {
                Unload();

                if (IsScrollEnabled)
                {
                    ConfigureWindows.GetMainWindow.Scroller.ScrollToTop();
                }

                ConfigureWindows.GetMainWindow.MainImage.Source = pic;

                FitImage(pic.PixelWidth, pic.PixelHeight);
                CloseToolTipMessage();

                SetTitleString(pic.PixelWidth, pic.PixelHeight, Application.Current.Resources["Base64Image"] as string);

                if (ConfigureWindows.GetImageInfoWindow != null)
                {
                    if (ConfigureWindows.GetImageInfoWindow.IsVisible)
                    {
                        ConfigureWindows.GetImageInfoWindow.UpdateValues();
                    }
                }
            }));

            Taskbar.NoProgress();

            CanNavigate = false;
        }