示例#1
0
        /// <summary>Creates a thumbnail based on RGB values with a single frame.</summary>
        /// <param name="file">The full path to the new image.</param>
        /// <param name="thumbFolder">The folder where the thumbnail should be saved.</param>
        /// <param name="rgb">The desired color as RGB values.</param>
        /// <param name="borderBrush">The border brush.</param>
        /// <param name="borderSize">Size of the border.</param>
        /// <param name="preview">The variant of the preview.</param>
        /// <param name="saveThumb">if set to <c>true</c> the thumbnail should save.</param>
        /// <returns>The preview BitmapImage.</returns>
        public BitmapImage BuildThumbnail(string file, string thumbFolder, byte[] rgb, SolidColorBrush borderBrush, int borderSize,
                                          ShowPreview preview, bool saveThumb)
        {
            if (preview == ShowPreview.No && !File.Exists(thumbFolder))
            {
                Directory.CreateDirectory(Path.Combine(Path.GetDirectoryName(file) + @"\", thumbFolder));
            }

            return(CreateThumbnail(file, thumbFolder, rgb, Border.Single, ColorConverterService.SolidColorBrushToSolidBrush(borderBrush), borderSize,
                                   null, 0, preview, saveThumb));
        }
示例#2
0
        /// <summary>Creates a thumbnail based on an existing image double a frame.</summary>
        /// <param name="file">The full path to the original image.</param>
        /// <param name="thumbFolder">The folder where the thumbnail should be saved.</param>
        /// <param name="outerBorderBrush">The outer border brush.</param>
        /// <param name="outerBorderSize">Size of the outer border.</param>
        /// <param name="innerBorderBrush">The inner border brush.</param>
        /// <param name="innerBorderSize">Size of the inner border.</param>
        /// <param name="preview">The variant of the preview.</param>
        /// <param name="saveThumb">if set to <c>true</c> the thumbnail should save.</param>
        /// <returns>The preview BitmapImage.</returns>
        public BitmapImage BuildThumbnail(string file, string thumbFolder, SolidColorBrush outerBorderBrush, int outerBorderSize,
                                          SolidColorBrush innerBorderBrush, int innerBorderSize, ShowPreview preview, bool saveThumb)
        {
            if (preview == ShowPreview.No && !File.Exists(thumbFolder))
            {
                Directory.CreateDirectory(Path.Combine(Path.GetDirectoryName(file) + @"\", thumbFolder));
            }

            return(CreateThumbnail(file, thumbFolder, Border.Double, ColorConverterService.SolidColorBrushToSolidBrush(outerBorderBrush),
                                   outerBorderSize, ColorConverterService.SolidColorBrushToSolidBrush(innerBorderBrush), innerBorderSize, preview, saveThumb));
        }