Calculates the needed parameters to place an image in Excel given its dimensions in pixels.
procedure CalcImgCells(const Workbook: TExcelFile; const Row: integer; const Col: integer; const dh: integer; const dw: integer; const ImgHeightInPixels: extended; const ImgWidthInPixels: extended; var Props: TImageProperties);
CalcImgCells(const TExcelFile Workbook, const int Row, const int Col, const int dh, const int dw, const extended ImgHeightInPixels, const extended ImgWidthInPixels, TImageProperties Props);
|
Parameters |
Description |
|
const Workbook: TExcelFile |
Workbook where you are going to place the image. FlexCel needs this value so it can know the height of rows and width of columns, so it can calculate how many rows and columns the image needs. |
|
const Row: integer |
Row where you are going to place the image. |
|
const Col: integer |
Column where you are going to place the image. |
|
const dh: integer |
Offset from the top of the row for the image. (1/255 of a cell. 0 means totally at the top, 128 on half of the cell, 255 means at the top of next cell.) |
|
const dw: integer |
Offset from the left of the cell for the image. (1/255 of a cell. 0 means totally at the top, 128 on half of the cell, 255 means at the top of next cell.) |
|
const ImgHeightInPixels: extended |
Height you want for the image to have in pixels. |
|
const ImgWidthInPixels: extended |
Width you want for the image to have in pixels. |
|
var Props: TImageProperties |
Returns the column and rows where the image will be placed. |
Normally you don't need to call this method directly, since TFlexCelImport has overload for the methods that accept image dimensions in pixels and internally use this method to enter the image in Excel.
Use CalcImgDimensions to make the inverse convert, from Excel units to pixels.
|
Copyright (c) 2002-2008 TMS Software. All rights reserved.
|
|
What do you think about this topic? Send feedback!
|