RasterImageResize Method (Int32, Int32, ImageResizeSettings) |
Namespace: Aspose.Imaging
[C#] string dir = "c:\\temp\\"; Aspose.Imaging.ImageResizeSettings resizeSettings = new Aspose.Imaging.ImageResizeSettings(); // The adaptive algorithm based on weighted and blended rational function and lanczos3 interpolation. resizeSettings.Mode = Aspose.Imaging.ResizeType.AdaptiveResample; // The small rectangular filter resizeSettings.FilterType = Aspose.Imaging.ImageFilterType.SmallRectangular; // The number of colors in the palette. resizeSettings.EntriesCount = 256; // The color quantization is not used resizeSettings.ColorQuantizationMethod = ColorQuantizationMethod.None; // The euclidian method resizeSettings.ColorCompareMethod = ColorCompareMethod.Euclidian; using (Aspose.Imaging.RasterImage image = (Aspose.Imaging.RasterImage)Aspose.Imaging.Image.Load(dir + "sample.gif")) { // Scale down by 2 times using adaptive resampling. image.Resize(image.Width / 2, image.Height / 2, resizeSettings); image.Save(dir + "downsample.adaptive.gif"); }