ImageEn, unit iexBitmaps

TIOParams.DpiX

TIOParams.DpiX


Declaration


property DpiX: integer;


Description


Specifies the horizontal Dpi (dots per inch) of the image.


Calculating DPI


The formulas for DPI are as follows:

dpiX := widthPixels div widthInches;
dpiY := heightPixels div heightInches;

widthPixels := widthInches * dpiX ;
heightPixels := heightInches * dpiY;

widthInches := widthPixels div dpiX ;
heightInches := heightPixels div dpiY;


Examples


// Show the width of the current image in inches/mm
lblWidth.Caption := IntToStr( Trunc( ImageEnView1.IO.Params.Width / ImageEnView1.IO.Params.DpiX )) + ' inches';
lblWidth.Caption := IntToStr( Trunc( ImageEnView1.IO.Params.Width / ImageEnView1.IO.Params.DpiX * 25.4 )) + ' mm';

// Set image dimensions to 8.5 x 11.7"
ImageEnView1.IO.Params.DpiX := Round( ImageEnView1.IO.Params.Width / 8.5 );
ImageEnView1.IO.Params.DpiY := Round( ImageEnView1.IO.Params.Height / 11.7 );


See Also


- Dpi
- DpiY
- ScaleX
- ScaleY
- SetScale