在TCanvas中,有没有似类TextOut输出文字的方法,输出转90度的文字
是不是可以在TFont中设置???

解决方案 »

  1.   

    你可以用1stClass4000中的Label来实现你的功能。
      

  2.   

    http://community.csdn.net/Expert/topic/2681/2681295.xml?temp=.2096674
      

  3.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Label1: TLabel;
        Label2: TLabel;
        Label3: TLabel;
        Label4: TLabel;
        Edit1: TEdit;
        Edit2: TEdit;
        Edit3: TEdit;
        Edit4: TEdit;
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    var
      LogicFont :TagLogFontA;
      //逻辑字体
      TempFont,PrevFont :HFONT;
      //字体句柄
      TempDC :HDC;
      //图形设备句柄
    begin
      LogicFont.lfHeight := 70;
      //设置字高
      LogicFont.lfWidth := 40;
      //设置字宽
      LogicFont.lfWeight := 10;
      //设置字体笔划粗细程度
      LogicFont.lfUnderline := 0;
      //设置下划线为没有
      LogicFont.lfStrikeOut := 0;
      //设置没有删除线
      LogicFont.lfItalic := 0;
      //设置不为斜体
      LogicFont.lfCharSet := GB2312_CHARSET;
      //设置字符集
      LogicFont.lfEscapement := -StrToInt(Edit2.Text)*10;
      LogicFont.lfOrientation := -StrToInt(Edit2.Text)*10;
      //设置顺时针方向与X轴的夹角
      LogicFont.lfFaceName := '宋体';
      //设置字体名称
      TempFont := CreateFontIndirect(LogicFont);
      //创建逻辑字体
      TempDC := GetDC(Handle);
      //取得窗口的设备句柄
      PrevFont := SelectObject(TempDC, TempFont);
      //取出窗口设备的当前字体,并替换为新字体
      SetTextColor(TempDC, clBlue);
      //设置设备窗口的文字色彩
      SetBkMode(TempDC,TRANSPARENT);
      //去掉文字白底
      TextOut(TempDC, StrToInt(Edit3.Text), StrToInt(Edit4.Text), PChar(Edit1.Text), Length(Edit1.Text));
      //输出文字
      SelectObject(TempDC, PrevFont);
      //恢复原有的字体
      DeleteObject(TempFont);
      //删除逻辑字体
      ReleaseDC(Handle, TempDC);
      //释放设备接口
    end;
    end.