Search Results for

    Show / Hide Table of Contents

    ExcelFile.SetImage Method

    Overloads

    • ExcelFile.SetImage(Int32, Byte[])
    • ExcelFile.SetImage(Int32, TUIImage)
    • ExcelFile.SetImage(Int32, Byte[], TXlsImgType)
    • ExcelFile.SetImage(Int32, Byte[], Boolean, String)
    • ExcelFile.SetImage(Int32, TUIImage, Boolean, String)
    • ExcelFile.SetImage(Int32, Byte[], TXlsImgType, Boolean, String)

    ExcelFile.SetImage(Int32, Byte[])

    Sets the image data for an existing image. It will try to automatically guess/convert the image type of the data to the better fit. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use SetImageAlternate

    Syntax

    Namespace: FlexCel.Core

    public void SetImage(Int32 imageIndex, Byte[] data)

    Parameters

    <-> Parameter Type Description
    imageIndex Int32 Index of the image on the sheet array (1-based)
    data Byte[] Image data.

    See also

    • ExcelFile

    ExcelFile.SetImage(Int32, TUIImage)

    Sets the image data for an existing image. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use SetImageAlternate

    Remarks

    Saving a WMF or EMF Image is not currently supported by the .NET framework. If you pass a MetaFile to this method, it will be saved as PNG. For inserting a REAL wmf into excel use AddImage(Stream, TXlsImgType, TImageProperties)

    Syntax

    Namespace: FlexCel.Core

    public void SetImage(Int32 imageIndex, TUIImage Img)

    Parameters

    <-> Parameter Type Description
    imageIndex Int32 Image Index. 1-Based.
    Img TUIImage Image to replace.

    See also

    • ExcelFile

    ExcelFile.SetImage(Int32, Byte[], TXlsImgType)

    Sets the image data and / or image properties of an existing image. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use SetImageAlternate

    Syntax

    Namespace: FlexCel.Core

    public void SetImage(Int32 imageIndex, Byte[] data, TXlsImgType imageType)

    Parameters

    <-> Parameter Type Description
    imageIndex Int32 Index of the image on the sheet array (1-based)
    data Byte[] Image data.
    imageType TXlsImgType Image type of the new data.

    See also

    • ExcelFile

    ExcelFile.SetImage(Int32, Byte[], Boolean, String)

    Sets the image data for an existing image. It will try to automatically guess/convert the image type of the data to the better fit. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use SetImageAlternate

    Syntax

    Namespace: FlexCel.Core

    public void SetImage(Int32 imageIndex, Byte[] data, Boolean usesObjectIndex, String objectPath)

    Parameters

    <-> Parameter Type Description
    imageIndex Int32 Index of the image on the sheet array (1-based)
    data Byte[] Image data.
    usesObjectIndex Boolean If false (the default) then imageIndex is an index to the list of images.
    When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
    objectPath String Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true.

    If it is "absolute"(it starts with "\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\1\2\3" is exactly the same as using objectIndex = 1 and objectPath = "2\3"

    See also

    • ExcelFile

    ExcelFile.SetImage(Int32, TUIImage, Boolean, String)

    Sets the image data for an existing image. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use SetImageAlternate

    Remarks

    Saving a WMF or EMF Image is not currently supported by the .NET framework. If you pass a MetaFile to this method, it will be saved as png. For inserting a REAL wmf into excel use AddImage(Stream, TXlsImgType, TImageProperties)

    Syntax

    Namespace: FlexCel.Core

    public void SetImage(Int32 imageIndex, TUIImage Img, Boolean usesObjectIndex, String objectPath)

    Parameters

    <-> Parameter Type Description
    imageIndex Int32 Image Index. 1-Based.
    Img TUIImage Image to replace.
    usesObjectIndex Boolean If false (the default) then imageIndex is an index to the list of images.
    When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
    objectPath String Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true.

    If it is "absolute"(it starts with "\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\1\2\3" is exactly the same as using objectIndex = 1 and objectPath = "2\3"

    See also

    • ExcelFile

    ExcelFile.SetImage(Int32, Byte[], TXlsImgType, Boolean, String)

    Sets the image data and / or image properties of an existing image. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use SetImageAlternate

    Syntax

    Namespace: FlexCel.Core

    public abstract void SetImage(Int32 imageIndex, Byte[] data, TXlsImgType imageType, Boolean usesObjectIndex, String objectPath)

    Parameters

    <-> Parameter Type Description
    imageIndex Int32 Index of the image on the sheet array (1-based)
    data Byte[] Image data.
    imageType TXlsImgType Image type of the new data.
    usesObjectIndex Boolean If false (the default) then imageIndex is an index to the list of images.
    When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
    objectPath String Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true.

    If it is "absolute"(it starts with "\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\1\2\3" is exactly the same as using objectIndex = 1 and objectPath = "2\3"

    See also

    • ExcelFile
    In This Article
    Back to top FlexCel Studio for the .NET Framework v7.24.0.0
    © 2002 - 2025 tmssoftware.com