コード例 #1
0
        /// <summary>
        /// Creates a bitmap thumbnail image scaled to fit the specified destination dimentions, with options to apply processing and effects.
        /// </summary>
        /// <param name="oImage">Specifies the image to the create the thumbnail image from.</param>
        /// <param name="nDestWidth">Specifies the destination width to scale the image to.</param>
        /// <param name="nDestHeight">Specifies the destination height to scale the image to.</param>
        /// <param name="bProcess">Specifies whether to apply high quality interpolation.</param>
        /// <param name="nEffect">Specifies whether to apply any effects the thumbnail.</param>
        /// <returns></returns>
        public static Bitmap CreateThumbnail(Image oImage, int nDestWidth, int nDestHeight, bool bProcess, ThumbnailEffect nEffect)
        {
            switch (nEffect)
            {
                case ThumbnailEffect.None:
                    return CreateDropShadowThumbnail(oImage, nDestWidth, nDestHeight, bProcess, false);
                case ThumbnailEffect.DropShadow:
                    return CreateDropShadowThumbnail(oImage, nDestWidth, nDestHeight, bProcess, true);
                case ThumbnailEffect.GradientBackground:
                    return CreateSimpleThumbnail(oImage, nDestWidth, nDestHeight, bProcess, true);
                case ThumbnailEffect.SimpleBorder:
                    return CreateSimpleThumbnail(oImage, nDestWidth, nDestHeight, bProcess, false);
            }

            return null;
        }
コード例 #2
0
 /// <summary>
 /// Creates a bitmap thumbnail image scaled to fit the specified destination dimentions, with options to apply processing and effects.
 /// </summary>
 /// <param name="oImage">Specifies the image to the create the thumbnail image from.</param>
 /// <param name="DestSize">Specifies the destination dimensions to scale the image to.</param>
 /// <param name="bProcess">Specifies whether to apply high quality interpolation.</param>
 /// <param name="nEffect">Specifies whether to apply any effects the thumbnail.</param>
 /// <returns></returns>
 public static Bitmap CreateThumbnail(Image oImage, Size DestSize, bool bProcess, ThumbnailEffect nEffect)
 {
     return CreateThumbnail(oImage, DestSize.Width, DestSize.Height, bProcess, nEffect);
 }