ImageEn, unit iexCanvasUtils

IEShapePreferredAspectRatio


Declaration

function IEShapePreferredAspectRatio(Shape: TIEShape): Double;


Description

Some shapes are best displayed at the ratio they were designed (typically 1:1). This method returns that preferred aspect ratio (equating to Width / Height ) or 0 if the shape has no preferred ratio.

Note: Defined in iexCanvasUtils unit


Example

aspectRatio := IEShapePreferredAspectRatio( iesHeart );  // Returns 1.0

aspectRatio := IEShapePreferredAspectRatio( iesMoon );   // Returns 0.5 (e.g. a 1:2 portrait ratio)

aspectRatio := IEShapePreferredAspectRatio( iesSmile );  // Returns 2.0 (e.g. a 2:1 landscape ratio)