FlexCel Studio for VCL/LCL
ContentsIndex
PreviousUpNext
CalcImgDimentions Function

Calculates the image dimensions in pixels given an Excel anchor.

Pascal
procedure CalcImgDimentions(const Workbook: TExcelFile; const Anchor: TClientAnchor; var XOfsPixel: extended; var YOfsPixel: extended; var w: extended; var h: extended); overload;
C++
CalcImgDimentions(const TExcelFile Workbook, const TClientAnchor Anchor, extended XOfsPixel, extended YOfsPixel, extended w, extended h);
Parameters 
Description 
const Workbook: TExcelFile 
File where the image is located. 
const Anchor: TClientAnchor 
Excel anchor indicating the columns and rows where the image is located. 
var XOfsPixel: extended 
Returns how many pixels the image is offset from the left of the cell. 
var YOfsPixel: extended 
Returns how many pixels the image is offset from the top of the cell. 
var w: extended 
Returns the width in pixels for the image 
var h: extended 
Returns the height in pixels from the image. 

This method is the reverse of CalcImgCells, and it gives you a way to calculate the width and height of an image in pixels.

Copyright (c) 2002-2008 TMS Software. All rights reserved.
What do you think about this topic? Send feedback!