Einzelnen Beitrag anzeigen

EmWieMichael

Registriert seit: 28. Mär 2012
103 Beiträge
 
#4

AW: Canvas.Textwidth liefert falschen Wert

  Alt 12. Jan 2017, 17:58
Ich mach das so:
Code:
function GetDots(S:String):Integer;
 var B:TBitMap; Font:TFont;
begin
  Font:=TFont.Create;
  Font.Name:='MS Sans Serif';
  Font.Height:=-11;
  Font.Size:=8;
  Font.Style:=[];
  Font.Pitch:=fpDefault;
  Font.PixelsPerInch:=96;
  B:=TBitMap.Create;
  B.Canvas.Font:=Font;
  Result:=B.Canvas.TextWidth(S);
  Font.Free;
  B.Free;
end;
  Mit Zitat antworten Zitat