Resize

WmfImage.Resize method (1 of 2)

Resizes the image.

public override void Resize(int newWidth, int newHeight, ResizeType resizeType)
Parameter Type Description
newWidth Int32 The new width.
newHeight Int32 The new height.
resizeType ResizeType The resize type.

Exceptions

exception condition
NotImplementedException

Examples

This example loads a WMF image and resizes it using various resizing methods.

[C#]

string dir = "c:\\temp\\";

using (Aspose.Imaging.FileFormats.Wmf.WmfImage image = (Aspose.Imaging.FileFormats.Wmf.WmfImage)Aspose.Imaging.Image.Load(dir + "sample.wmf"))
{
    // Scale up by 2 times using Nearest Neighbour resampling.
    image.Resize(image.Width * 2, image.Height * 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
}

using (Aspose.Imaging.FileFormats.Wmf.WmfImage image = (Aspose.Imaging.FileFormats.Wmf.WmfImage)Aspose.Imaging.Image.Load(dir + "sample.wmf"))
{
    // Scale down by 2 times using Nearest Neighbour resampling.
    image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
}

using (Aspose.Imaging.FileFormats.Wmf.WmfImage image = (Aspose.Imaging.FileFormats.Wmf.WmfImage)Aspose.Imaging.Image.Load(dir + "sample.wmf"))
{
    // Scale up by 2 times using Bilinear resampling.
    image.Resize(image.Width * 2, image.Height * 2, Aspose.Imaging.ResizeType.BilinearResample);
}

using (Aspose.Imaging.FileFormats.Wmf.WmfImage image = (Aspose.Imaging.FileFormats.Wmf.WmfImage)Aspose.Imaging.Image.Load(dir + "sample.wmf"))
{
    // Scale down by 2 times using Bilinear resampling.
    image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.BilinearResample);
}

See Also


WmfImage.Resize method (2 of 2)

Resizes the image.

public override void Resize(int newWidth, int newHeight, ImageResizeSettings settings)
Parameter Type Description
newWidth Int32 The new width.
newHeight Int32 The new height.
settings ImageResizeSettings The resize settings.

Exceptions

exception condition
NotImplementedException

See Also