TXlsFile.RenderObject Method
This method renders any object (chart, image, autoshape, etc) into an image, and returns it.
Syntax
Unit: FlexCel.XlsAdapter
function TXlsFile.RenderObject(const objectIndex: Integer; const dpi: Double; shapeProperties: IShapeProperties; const aSmoothingMode: TSmoothingMode; const aInterpolationMode: TInterpolationMode; const antiAliased: Boolean; const returnImage: Boolean; const BackgroundColor: TUIColor; const aPrintScale: Double; out origin: TUIPointF; out imageDimensions: TUIRectangle; out imageSizePixels: TUISize): TUIImage; overload; override;
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
const | objectIndex | Integer | 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. |
const | dpi | Double | Resolution of the image to create in dots per inch. If creating the image for the screen, use 96 dpi. |
shapeProperties | IShapeProperties | Properties of the shape you are about to render. You can get them by calling TExcelFile.GetObjectProperties(Integer, Boolean). | |
const | aSmoothingMode | TSmoothingMode | Smoothing mode used to render the object. For more information, see "System.Drawing.Drawing2D.SmoothingMode" |
const | aInterpolationMode | TInterpolationMode | Interpolation mode used to render the object. For more information, see "System.Drawing.Drawing2D.InterpolationMode" |
const | antiAliased | Boolean | If true text will be antialiased when rendering for example a chart. |
const | 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. |
const | BackgroundColor | TUIColor | Color for the background of the image. For a transparent background, use TUIColor.Empty. |
const | aPrintScale | Double | |
out | origin | TUIPointF | 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 TExcelFile.GetImageProperties(Integer) 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.