Ejemplo n.º 1
0
        /// <summary>
        /// Creates the thumbnail.
        /// </summary>
        /// <param name="outputPath">The output path.</param>
        /// <param name="width">Width.</param>
        /// <param name="height">Height.</param>
        public void CreateThumbnail(string outputPath, int width, int height)
        {
            GdPictureImaging image = new GdPictureImaging();
            int imageId            = image.CreateGdPictureImageFromFile(ImagePath);

            if (imageId > 0)
            {
                int thumbnailId = image.CreateThumbnailHQ(imageId, width, height, Color.Black);
                image.SaveAsJPEG(thumbnailId, outputPath);
                image.ReleaseGdPictureImage(imageId);
            }

            GarbageCollector.Collect();
        }