Resize

EpsImage.Resize method (1 of 2)

Resizes the image.

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

Examples

Resize EPS image and export it to PNG format.

[C#]

// Load EPS image
using (var image = Image.Load("AstrixObelix.eps"))
{
    // Resize the image using the Mitchell cubic interpolation method
    image.Resize(400, 400, ResizeType.Mitchell);

    // Export image to PNG format
    image.Save("ExportResult.png", new PngOptions());
}

See Also


EpsImage.Resize method (2 of 2)

Resizes the image.

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

Examples

Resize EPS image using advanced settings.

[C#]

// Load EPS image
using (var image = Image.Load("AstrixObelix.eps"))
{
    // Resize the image using advanced resize settings
    image.Resize(400, 400, new ImageResizeSettings
    {
        // Set the interpolation mode
        Mode = ResizeType.LanczosResample,

        // Set the type of the filter
        FilterType = ImageFilterType.SmallRectangular,

        // Sets the color compare method
        ColorCompareMethod = ColorCompareMethod.Euclidian,

        // Set the color quantization method
        ColorQuantizationMethod = ColorQuantizationMethod.Popularity
    });

    // Export image to PNG format
    image.Save("ExportResult.png", new PngOptions());
}

See Also