CreateThumbNail

Easy to create high quality image thumbnails

Most simple use:

CreateThumbNailToFile(String sourceImageFileName, Int32 maxWidth, Int32 maxHeight, ImageQualitySettings qualitySettings)

e.g.

ImageQualitySettings settings = new ImageQualitySettings();
settings.ImageType = ImageType.Gif;
settings.Quality = 255;
ImageAide.CreateThumbNailToFile(@"c:\websites\test\images\logo.gif", 50, 50, settings);


By default the method will generate a thumbnail file using the following format: source filename_widthxheight.extension

e.g. logo.gif = logo_50x50.gif

qualitySettings: Provides many options to configure the quality of the image generated e.g. number of colors to be used, jpeg quality.

Full parameters:

CreateThumbNailToFile(String sourceImageFileName, Int32 maxWidth, Int32 maxHeight, ImageQualitySettings qualitySettings, string outputFileName, ThumbNailWriteFileOption writeOption)

writeOption: Overwrite, OverwriteIfOriginalIsNewer, IgnoreIfExists. Can be used to prevent a thumbnail image being recreated if it has already been created.


*Please note, you can use CreateThumbNail method rather than the CreateThumbNailToFile. This works as above but generates the image into a Stream parameter rather than writing directly to a file.

Last edited Mar 10, 2007 at 10:51 AM by stebrennan, version 2

Comments

No comments yet.