Search Results for

    Show / Hide Table of Contents

    Interface IImage

    Interface that represents a picture in a Excel document.

    Namespace: IronXL.Drawing.Images
    Assembly: IronXL.dll
    Syntax
    public interface IImage

    Properties

    Data

    Gets the byte representation of the image.

    Declaration
    byte[] Data { get; }
    Property Value
    Type Description
    System.Byte[]

    Id

    Gets the index of the image in workbook array.

    Declaration
    int Id { get; }
    Property Value
    Type Description
    System.Int32

    ImageFormat

    Gets the format of the image.

    Declaration
    ImageFormat ImageFormat { get; }
    Property Value
    Type Description
    ImageFormat

    Position

    Gets the position of the image.

    Declaration
    Position Position { get; }
    Property Value
    Type Description
    Position

    Methods

    Resize()

    Reset the image to the dimension of the embedded image

    Declaration
    void Resize()

    Resize(Double)

    Resize the image proportionally.

    Declaration
    void Resize(double scale)
    Parameters
    Type Name Description
    System.Double scale

    The scale percentage.

    Resize(Double, Double)

    Resize the image.

    Please note, that this method works correctly only for workbooks with the default font size (Arial 10pt for .xls and Calibri 11pt for .xlsx). If the default font is changed the resized image can be stretched vertically or horizontally.

    Declaration
    void Resize(double scaleX, double scaleY)
    Parameters
    Type Name Description
    System.Double scaleX

    The scale x (horizontal). 100 is normal scale.

    System.Double scaleY

    The scale y (vertical). 100 is normal scale.

    ToAnyBitmap()

    Creates IronSoftware.Drawing.AnyBitmap object from the image data(array of bytes).

    Note : Don't forget to release all the resources used by this Bitmap calling Dispose() method.

    Declaration
    AnyBitmap ToAnyBitmap()
    Returns
    Type Description
    IronSoftware.Drawing.AnyBitmap

    The newly created IronSoftware.Drawing.AnyBitmap object

    ToImage()

    Creates System.Drawing.Image object from the image data(array of bytes).

    Note : Don't forget to release all the resources used by this Image calling Dispose() method.

    Declaration
    Image ToImage()
    Returns
    Type Description
    SixLabors.ImageSharp.Image

    The newly created SixLabors.ImageSharp.Image object

    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    Want to deploy IronXL to a live project for FREE?
    What’s included?
    30 days of fully-functional product
    Test and share in a live environment
    No watermarks in production
    Get your free 30-day Trial Key instantly.
    No credit card or account creation required
    Your Trial License Key has been emailed to you.
    Download IronXL free to apply
    your Trial Licenses Key
    Install with NuGet View Licenses
    Licenses from $499. Have a question? Get in touch.