Search Results for

    Show / Hide Table of Contents

    ExcelFile.RenderObject Method

    Overloads

    • ExcelFile.RenderObject(Int32)
    • ExcelFile.RenderObject(Int32, String)
    • ExcelFile.RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TPointF, TUIRectangle, TUISize)
    • ExcelFile.RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TUIColor, TPointF, TUIRectangle, TUISize)
    • ExcelFile.RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TUIColor, Double, TPointF, TUIRectangle, TUISize)

    ExcelFile.RenderObject(Int32)

    This method renders any object (chart, image, autoshape, etc) into an image, and returns it.

    Background of the image will be transparent.

    Syntax

    Namespace: FlexCel.Core

    public TUIImage RenderObject(Int32 objectIndex)

    Parameters

    <-> Parameter Type Description
    objectIndex Int32 Index of the object (1 based).

    Returns

    Might return null if the image is not visible.

    See also

    • ExcelFile

    ExcelFile.RenderObject(Int32, String)

    This method renders any object (chart, image, autoshape, etc) into an image, and returns it.

    Background of the image will be transparent.

    Remarks

    This method uses DpiForImages to determine the dpi of the returned image, and sets all other values in other overload of RenderObject to their defaults. If you need more control over the parameters passed to RenderObject, you can use any overload which takes a TShapeProperties parameter, and pass a shapeProperties from the object you want to render. While those overloads take an objectIndex and no objectPath, what is used for rendering is the shapeProperties. The objectIndex is only used to determine the position of the object in the z axis.

    Syntax

    Namespace: FlexCel.Core

    public TUIImage RenderObject(Int32 objectIndex, String objectPath)

    Parameters

    <-> Parameter Type Description
    objectIndex Int32 Index of the object (1 based).
    objectPath String Path to the object to render. Look at GetObjectProperties(Int32, String, Boolean) for a description of the possible values.

    Returns

    Might return null if the image is not visible.

    Examples

    To save the image of a chart named "my_pie_chart" to disk as a png image, you can use the code:

        using (TUIImage img = xls.RenderObject(-1, "@my_pie_chart"))
        {
            img.Save("myfilename.png", TXlsImgType.Png);
        }
    

    See also

    • ExcelFile

    ExcelFile.RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TPointF, TUIRectangle, TUISize)

    This method renders any object (chart, image, autoshape, etc) into an image, and returns it.

    Syntax

    Namespace: FlexCel.Core

    public TUIImage RenderObject(Int32 objectIndex, Double dpi, TShapeProperties shapeProperties, TUISmoothingMode aSmoothingMode, TUIInterpolationMode aInterpolationMode, Boolean antiAliased, Boolean returnImage, out TPointF origin, out TUIRectangle imageDimensions, out TUISize imageSizePixels)

    Parameters

    <-> Parameter Type Description
    objectIndex Int32 Index of the object (1 based).

    Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
    dpi Double Resolution of the image to create in dots per inch. If creating the image for a low-resolution screen, use 96 dpi.
    shapeProperties TShapeProperties Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
    aSmoothingMode TUISmoothingMode Smoothing mode used to render the object. For more information, see "System.Drawing.Drawing2D.SmoothingMode"
    aInterpolationMode TUIInterpolationMode Interpolation mode used to render the object. For more information, see "System.Drawing.Drawing2D.InterpolationMode"
    antiAliased Boolean If true text will be antialiased when rendering for example a chart.
    returnImage Boolean If false, this method will return null. Use it if you need to know the image dimensions, but do not care about the real image since it is faster and uses less resources.
    out origin TPointF Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
    out imageDimensions TUIRectangle Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image. You can get the image size in pixels just by looking at the image returned.
    out imageSizePixels TUISize Size of the returned image in pixels. You only need to use this if returnImage is false, since the returned bitmap will be null. Otherwise, you can just read the bitmap size.

    Returns

    Might return null if the image is not visible.

    See also

    • ExcelFile

    ExcelFile.RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TUIColor, TPointF, TUIRectangle, TUISize)

    This method renders any object (chart, image, autoshape, etc) into an image, and returns it.

    Syntax

    Namespace: FlexCel.Core

    public TUIImage RenderObject(Int32 objectIndex, Double dpi, TShapeProperties shapeProperties, TUISmoothingMode aSmoothingMode, TUIInterpolationMode aInterpolationMode, Boolean antiAliased, Boolean returnImage, TUIColor BackgroundColor, out TPointF origin, out TUIRectangle imageDimensions, out TUISize imageSizePixels)

    Parameters

    <-> Parameter Type Description
    objectIndex Int32 Index of the object (1 based).

    Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
    dpi Double Resolution of the image to create in dots per inch. If creating the image for the screen, use 96 dpi.
    shapeProperties TShapeProperties Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
    aSmoothingMode TUISmoothingMode Smoothing mode used to render the object. For more information, see "System.Drawing.Drawing2D.SmoothingMode"
    aInterpolationMode TUIInterpolationMode Interpolation mode used to render the object. For more information, see "System.Drawing.Drawing2D.InterpolationMode"
    antiAliased Boolean If true text will be antialiased when rendering for example a chart.
    returnImage Boolean If false, this method will return null. Use it if you need to know the image dimensions, but do not care about the real image since it is faster and uses less resources.
    BackgroundColor TUIColor Color for the background of the image. For a transparent background, use TUIColor.Empty.
    out origin TPointF Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
    out imageDimensions TUIRectangle Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image. You can get the image size in pixels just by looking at the image returned.
    out imageSizePixels TUISize Size of the returned image in pixels. You only need to use this if returnImage is false, since the returned bitmap will be null. Otherwise, you can just read the bitmap size.

    Returns

    Might return null if the image is not visible.

    See also

    • ExcelFile

    ExcelFile.RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TUIColor, Double, TPointF, TUIRectangle, TUISize)

    This method renders any object (chart, image, autoshape, etc) into an image, and returns it.

    Syntax

    Namespace: FlexCel.Core

    public abstract TUIImage RenderObject(Int32 objectIndex, Double dpi, TShapeProperties shapeProperties, TUISmoothingMode aSmoothingMode, TUIInterpolationMode aInterpolationMode, Boolean antiAliased, Boolean returnImage, TUIColor BackgroundColor, Double aPageScale, out TPointF origin, out TUIRectangle imageDimensions, out TUISize imageSizePixels)

    Parameters

    <-> Parameter Type Description
    objectIndex Int32 Index of the object (1 based).

    Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
    dpi Double Resolution of the image to create in dots per inch. If creating the image for the screen, use 96 dpi.
    shapeProperties TShapeProperties Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
    aSmoothingMode TUISmoothingMode Smoothing mode used to render the object. For more information, see "System.Drawing.Drawing2D.SmoothingMode"
    aInterpolationMode TUIInterpolationMode Interpolation mode used to render the object. For more information, see "System.Drawing.Drawing2D.InterpolationMode"
    antiAliased Boolean If true text will be antialiased when rendering for example a chart.
    returnImage Boolean If false, this method will return null. Use it if you need to know the image dimensions, but do not care about the real image since it is faster and uses less resources.
    BackgroundColor TUIColor Color for the background of the image. For a transparent background, use TUIColor.Empty.
    aPageScale Double Page scale. Use 1 for 100%
    out origin TPointF Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
    out imageDimensions TUIRectangle Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image. You can get the image size in pixels just by looking at the image returned.
    out imageSizePixels TUISize Size of the returned image in pixels. You only need to use this if returnImage is false, since the returned bitmap will be null. Otherwise, you can just read the bitmap size.

    Returns

    Might return null if the image is not visible.

    See also

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