Ejemplo n.º 1
0
        /// <summary>
        /// Adjusts the image for different themes
        /// </summary>
        public static Image AdjustImage(Image image)
        {
            String style = Globals.MainForm.GetThemeValue("ImageManager.ImageSet");

            if (style == "Bright")
            {
                return(ImageKonverter.ImageAdjust(image, 20, 0));
            }
            else if (style == "Dim")
            {
                return(ImageKonverter.ImageAdjust(image, -5, -2));
            }
            else if (style == "Dark")
            {
                return(ImageKonverter.ImageAdjust(image, -5, -10));
            }
            else if (style == "Darker")
            {
                return(ImageKonverter.ImageAdjust(image, -20, -20));
            }
            else if (style == "Black")
            {
                return(ImageKonverter.ImageAdjust(image, -50, -25));
            }
            else
            {
                return(image);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets an adjusted copy of the specified image.
        /// </summary>
        public static Image SetImageAdjustment(Image original)
        {
            int saturation, brightness;

            if (GetImageAdjustments(out saturation, out brightness))
            {
                return(ImageKonverter.ImageAdjust(original, saturation, brightness));
            }
            return(new Bitmap(original));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Adjust colors of all cached images.
        /// </summary>
        public static void AdjustAllImages()
        {
            int saturation, brightness;

            GetImageAdjustments(out saturation, out brightness);

            for (int i = 0, length = AutoAdjusted.Count; i < length; i++)
            {
                var imagePair = AutoAdjusted[i];
                var adjusted  = imagePair.Adjusted;
                if (adjusted == null)
                {
                    AutoAdjusted.RemoveAt(i--);
                    length--;
                }
                else
                {
                    ImageKonverter.ImageAdjust(imagePair.Original, adjusted, saturation, brightness);
                }
            }
        }