示例#1
0
 /// <summary>
 /// Fits the specified image to the supplied max width / height.
 /// </summary>
 /// <param name="image">The image.</param>
 /// <param name="maxWidthHeight">max width / height.</param>
 /// <param name="fitMode">The fit mode.</param>
 /// <param name="scaleMode">The scale mode.</param>
 /// <param name="alignMode">The align mode.</param>
 /// <param name="format">The format.</param>
 /// <param name="quality">The quality.</param>
 /// <param name="colors">The colors.</param>
 /// <param name="bgColor">Color of the background.</param>
 /// <returns></returns>
 public static IFilteredImage Fit(this IImageFile image, int maxWidthHeight,
                                  FitMode fitMode     = FitMode.Pad, ScaleMode scaleMode = ScaleMode.Down,
                                  AlignMode alignMode = AlignMode.MiddleCenter, ImageFormat format = ImageFormat.Auto,
                                  int quality         = 90, int colors = 256, string bgColor = "")
 {
     return(image.Fit(maxWidthHeight, maxWidthHeight, fitMode, scaleMode, alignMode,
                      format, quality, colors, bgColor));
 }