ok hier ein bisschen code:
Delphi-Quellcode:
function GetPrinterRes(const pobj: TPrinter; Horz: Boolean): integer;
var
Index: Integer;
begin
if Horz then
Index:=LOGPIXELSX
else
Index:=LOGPIXELSY;
Result:=GetDeviceCaps(pobj.Handle, Index);
end;
function ConvertPixelstoMMX(const Value:Integer):Double;
begin
Result := Value / GetPrinterRes(Printer, True) * mmPerInch;
end;
...
hlplabel.Caption := hlplst.Strings[x];
length := length + roundto(ConvertPixelsToMMX(hlplabel.Width), -2);
length := length / 10;
pllength.Caption := floattostr(length) + ' m';