cimnik2999
Programmer
How do i calculate TwipsPerPixlesX and Y? (a counterpart to the VB function would be nice)...
Thanxs
Thanxs
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
function TwipsPerPixelX(Canvas : TCanvas) : Extended;
begin
result := 440 / GetDeviceCaps(Canvas.Handle, LOGPIXELSX);
end;
function TwipsPerPixelY(Canvas : TCanvas) : Extended;
begin
result := 440 / GetDeviceCaps(Canvas.Handle, LOGPIXELSY);
end;
procedure TForm1.ButtonClick(Sender: TObject);
begin
ShowMessage( FloatToStr(TwipsPerPixelX(Form.Canvas)));
ShowMessage( FloatToStr(TwipsPerPixelY(Form.Canvas)));
end;
extX := TwipsPerPixelX( Screen.ActiveForm.Canvas )
extY := TwipsPerPixelY( Screen.ActiveForm.Canvas )