T
tommy_linux
Unregistered / Unconfirmed
GUEST, unregistred user!
uses printers
ppix, ppiy: Integer;
procedure Getppi(DC: HDC);
begin
ppix := GetDeviceCaps(DC, logPixelsX);
ppiy := GetDeviceCaps(DC, logPixelsY);
end;
function CmToPixelX(cm: Real): Integer;
begin
Result := Trunc(Cm * ppix / 2.54);
end;
function CmToPixelY(cm: Real): integer;
begin
Result := Trunc(Cm * ppiy /2.54);
end;
有前辈说上面所述,但不知如何调用~~~~~
print.canvas.textout(CmToPixelx(10),CmToPixelY(12) ,edit.text);
这样对吗?
ppix, ppiy: Integer;
procedure Getppi(DC: HDC);
begin
ppix := GetDeviceCaps(DC, logPixelsX);
ppiy := GetDeviceCaps(DC, logPixelsY);
end;
function CmToPixelX(cm: Real): Integer;
begin
Result := Trunc(Cm * ppix / 2.54);
end;
function CmToPixelY(cm: Real): integer;
begin
Result := Trunc(Cm * ppiy /2.54);
end;
有前辈说上面所述,但不知如何调用~~~~~
print.canvas.textout(CmToPixelx(10),CmToPixelY(12) ,edit.text);
这样对吗?