在椭圆内写入汉字!汉字随椭圆弧度排列!汉字旋转的角度要与该点于水平夹角相等!
当椭圆的纵轴或短轴变化的时候文字的位置跟着变化!
希望能得到解答!谢谢!

解决方案 »

  1.   

    //看以下我写的代码能否满足楼主需求(可是原创呀!^_^)
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}
    procedure MyTextOut(Ca:TCanvas;X,Y,Angle:Integer;Text:String);
    var
      lf : TLogFont;
    begin
      with Ca do
      begin
        GetObject(Font.Handle, sizeof(lf), @lf);
        lf.lfEscapement := Angle*10;
        Font.Handle := CreateFontIndirect(lf);
        TextOut(X,Y,Text);
        lf.lfEscapement := 0;
        lf.lfOrientation := 0;
        Font.Handle := CreateFontIndirect(lf);
      end;
    end;
    procedure CircleText(Ca:TCanvas;X0,Y0,RX,RY,BeginAngle,EndAngle:Integer;Text:WideString);
    const
      aq=180/3.1415926;
      qa=3.1415926/180;
      procedure _CircleAlpha(Ca:TCanvas;X0,Y0,RX,RY,Angle:Integer;Alpha:WideChar);
      var
        x,y:Integer;
        tw,th:Double;
      begin
        tw:=Ca.TextWidth(Alpha) / 2;
        th:=Ca.TextWidth(Alpha) / 2;
        x:=Round(Cos((Angle-90)*qa)*tw)+X0;
        y:=Round(Sin((Angle-90)*qa)*tw)+Y0;
        x:=Round(Cos(Angle*qa)*RX)+x;
        y:=Round(Sin(Angle*qa)*RY)+y;
        MyTextOut(Ca,x,y,270-Angle,Alpha);
      end;
    var
      Angle,Step:Double;
      n:Integer;
    begin
      Step:=(EndAngle-BeginAngle)/Length(Text);
      Angle:=BeginAngle;
      for n:=1 to Length(Text) do
      begin
        _CircleAlpha(Ca,X0,Y0,RX,RY,Round(Angle),Text[n]);
        Angle:=Angle+Step;
      end;
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
      Canvas.Font.Name:='宋体';
      Canvas.Font.Color:=clBlue;
      Canvas.Font.Size:=12;
      CircleText(Canvas,200,200,150,100,180,360,'I am Wizardqi(男巫)!');
    end;end.
      

  2.   

    参考:http://community.csdn.net/Expert/topic/4417/4417147.xml?temp=.731518