RasterCachedImage.Resize

Resize(int, int, ResizeType)

Resizes the image.

public override void Resize(int newWidth, int newHeight, ResizeType resizeType)
ParameterTypeDescription
newWidthInt32The new width.
newHeightInt32The new height.
resizeTypeResizeTypeThe resize type.

Examples

The following code demonstrates how to resize an image with a new SinC resize type.

[C#]

string sourceFile = "sample.psd";
string destName = "ResamplerSinCStripes_after.psd";

// Load an existing image into an instance of PsdImage class
using (PsdImage image = (PsdImage)Image.Load(sourceFile))
{
    image.Resize(300, 300, ResizeType.SinC);
    image.Save(destName, new PsdOptions(image));
}

The following code demonstrates how to resize an image with a new Bell resize type.

[C#]

string sourceFile = "sample.psd";
string destName = "ResamplerBellStripes_after.psd";

// Load an existing image into an instance of PsdImage class
using (PsdImage image = (PsdImage)Image.Load(sourceFile))
{
    image.Resize(300, 300, ResizeType.Bell);
    image.Save(destName, new PsdOptions(image));
}

The following code demonstrates how to resize an image with a new Mitchell resize type.

[C#]

string sourceFile = "sample.psd";
string destName = "ResamplerMitchellStripes_after.psd";

// Load an existing image into an instance of PsdImage class
using (PsdImage image = (PsdImage)Image.Load(sourceFile))
{
    image.Resize(300, 300, ResizeType.Mitchell);
    image.Save(destName, new PsdOptions(image));
}

The following code demonstrates how to resize an image with a new CatmullRom resize type.

[C#]

string sourceFile = "sample.psd";
string destName = "ResamplerCatmullRomStripes_after.psd";

// Load an existing image into an instance of PsdImage class
using (PsdImage image = (PsdImage)Image.Load(sourceFile))
{
    image.Resize(300, 300, ResizeType.CatmullRom);
    image.Save(destName, new PsdOptions(image));
}

The following code demonstrates how to resize an image with a new CubicBSpline resize type.

[C#]

string sourceFile = "sample.psd";
string destName = "ResamplerCubicBSplineStripes_after.psd";

// Load an existing image into an instance of PsdImage class
using (PsdImage image = (PsdImage)Image.Load(sourceFile))
{
    image.Resize(300, 300, ResizeType.CubicBSpline);
    image.Save(destName, new PsdOptions(image));
}

The following code demonstrates how to resize an image with a new CubicConvolution resize type.

[C#]

string sourceFile = "sample.psd";
string destName = "ResamplerCubicConvolutionStripes_after.psd";

// Load an existing image into an instance of PsdImage class
using (PsdImage image = (PsdImage)Image.Load(sourceFile))
{
    image.Resize(300, 300, ResizeType.CubicConvolution);
    image.Save(destName, new PsdOptions(image));
}

See Also


Resize(int, int, ImageResizeSettings)

Resizes the image.

public override void Resize(int newWidth, int newHeight, ImageResizeSettings settings)
ParameterTypeDescription
newWidthInt32The new width.
newHeightInt32The new height.
settingsImageResizeSettingsThe resize settings.

See Also