|
May 11, 2007 at 07:04 PM |
procedure PixelsPerMM(
canvas: TCanvas;
var x, y: single) ;
var
H:HDC;
hres,vres,
hsiz,vsiz:integer;
begin
H:=canvas.handle;
hres := GetDeviceCaps(H,HORZRES) ; {display width in pixels}
vres := GetDeviceCaps(H,VERTRES) ; {display height in pixels}
hsiz := GetDeviceCaps(H,HORZSIZE) ; {display width in mm}
vsiz := GetDeviceCaps(H,VERTSIZE) ; {display height in mm}
x := hres/hsiz;
y := vres/vsiz;
end; references
|