ViaThinkSoft CodeLib
This article is in:
CodeLib → Programming aids → Delphi
procedure TDLG_Hauptfenster.FormPaint(Sender: TObject);
const
text = 'Beispiel';
var
x, y: Int64;
begin
Canvas.Lock;
try
canvas.font.Color := clGrayText;
Canvas.Font.Name := 'Arial';
Canvas.Font.Height := -130;
Canvas.Font.Style := [fsBold, fsItalic];
x := round((ClientWidth - Canvas.TextWidth(text)) / 2);
y := round((ClientHeight - Canvas.TextHeight(text)) / 2);
Canvas.TextOut(x, y, text);
finally
Canvas.Unlock;
end;
end;
Daniel Marschall
ViaThinkSoft Co-Founder
ViaThinkSoft Co-Founder