Завъртян текст
2 отговора
135 прегледа
Завъртян текст
Знае ли някой как се извежда върху Canvas текст под ъгъл, примерно от т. (X, Y) нагоре? Благодаря!
Re: Завъртян текст
Ето едно примерче:
procedure RotateText;
var
lf : TLogFont;
tf : TFont;
begin
with Form1.Canvas do
begin
Font.Name := 'Arial';
Font.Size := 24;
tf := TFont.Create;
tf.Assign(Font);
GetObject(tf.Handle, sizeof(lf), @lf);
lf.lfEscapement := 450; // ротация на
lf.lfOrientation := 450; // 45°
tf.Handle := CreateFontIndirect(lf);
Font.Assign(tf);
tf.Free;
TextOut(20, Height div 2, 'Rotated Text!');
end;
end;


procedure RotateText;
var
lf : TLogFont;
tf : TFont;
begin
with Form1.Canvas do
begin
Font.Name := 'Arial';
Font.Size := 24;
tf := TFont.Create;
tf.Assign(Font);
GetObject(tf.Handle, sizeof(lf), @lf);
lf.lfEscapement := 450; // ротация на
lf.lfOrientation := 450; // 45°
tf.Handle := CreateFontIndirect(lf);
Font.Assign(tf);
tf.Free;
TextOut(20, Height div 2, 'Rotated Text!');
end;
end;