以某一角度显示文字:
  创建一logfont,在logfong中定义字体的方向....创建该字体,使用该字体输出.

解决方案 »

  1.   

    看看下面的代码:
    procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
    Shift: TShiftState; X, Y: Integer);
    var
    LogFont : TLogFont;
    newFont : TFont;
    begin
    with Form1.Canvas do
    begin
    Font.Name := '黑体'; // 字体
    Font.Size := 32; // 字号
    Font.Color:= $00ffcc; // 颜色
    // 创建新字体
    newFont := TFont.Create;
    newFont.Assign(Font); // 新字体继承窗体字体的属性
    // 为新字体设置旋转属性
    GetObject(newFont.Handle, sizeof(LogFont), @LogFont);
    LogFont.lfEscapement :=900; //角度*10
    LogFont.lfOrientation :=600; //应设为同样的值
    LogFont.lfWidth:=20; //每个字符的大小
    LogFont.lfHeight:=90;
    newFont.Handle := CreateFontIndirect(LogFont);
    Font.Assign(newFont);
    newFont.Free;
    // 在鼠标按下的位置显示文字
    TextOut(X, Y, '旋转文字Demo');
    end;
    end;