EpsImage.Resize

Resize(int, int, ResizeType)

This method resizes the image, adjusting its dimensions according to specified parameters. It offers a straightforward way to modify the size of the image, ensuring flexibility and ease of use for developers.

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


Resize(int, int, ImageResizeSettings)

This method resizes the image using predefined settings, allowing for efficient adjustment of dimensions. It provides a convenient way to modify the image size while maintaining control over various parameters, ensuring optimal results for different use cases.

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