GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / Scale Method
GdPicture image identifier.
Scale percentage value. ie: if ScalePercent = 50, the image is reduced to half size.
A member of the Drawing2D.InterPolationMode enumeration.
Example





In This Topic
Scale Method (GdPictureImaging)
In This Topic
Resizes a GdPicture image image, keeping the same aspect ratio.
Syntax

Parameters

ImageID
GdPicture image identifier.
ScalePercent
Scale percentage value. ie: if ScalePercent = 50, the image is reduced to half size.
InterpolationMode
A member of the Drawing2D.InterPolationMode enumeration.

Return Value

A member of the GdPictureStatus enumeration.
Remarks
This method automatically adjusts the vertical and horizontal image resolution in order to maintain the aspect ratio. If the intention is to change the aspect ratio, the SetVerticalResolution() and/or SetHorizontalResolution() methods should be used instead.
Example
Rescaling an image and saving as a png.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.png", false);
    gdpictureImaging.Scale(imageID, 95.0f, System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic);
    gdpictureImaging.SaveAsPNG(imageID, "output.png");
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also