各位大哥,有没有什么办法将一个字符旋转90度再显示出来啊?

解决方案 »

  1.   

    呵呵,请参阅下文:
    《Delphi利用Windows GDI实现文字倾斜》http://www.yesky.com/20010702/187569.shtml
      

  2.   

    FillChar(FLogFont,Sizeof(TLogFont),0);
          With FlogFont do
          begin
           lfHeight:=Font.Height;
           lfWidth:=0;
           lfEscapement:=2700;     //想旋转多少度,修改这里的参数就可以了啊
           lforientation:=lfEscapement;
           lfWeight:=Fw_Normal;
           lfItalic:=0;
           lfUnderline:=0;
           lfStrikeOut:=0;
           lfCharSet:=Ansi_CHARSET;
           StrPCopy(lfFaceName,Font.Name);
           lfQuality:=PROOF_QUALITY;
           lfOutPrecision:=OUT_TT_ONLY_PRECIS;
           lfClipPrecision:=CLIP_DEFAULT_PRECIS;
           lfPitchAndFamily:=Variable_Pitch;
          end;
          Font.Handle:=CreateFontIndirect(FLogFont);      Textout(x,y,'旋转文字');
      

  3.   

    //旋转字体
    procedure TForm1.Button1Click(Sender: TObject);
    var
     lf:tlogfont;
     tf:tfont;
    begin
     with form1.Canvas do
     begin
      font.Name:='黑体';
      font.Size:=24;
      tf:=tfont.Create;
      tf.Assign(font);
      getobject(tf.handle,sizeof(lf),@lf);
      lf.lfEscapement:=450;
      lf.lfOrientation:=450;
      tf.handle:=createfontindirect(lf);
      font.assign(tf);
      tf.Free;
      textout(20,height div 2,'你好');
     end;
    end;
      

  4.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
      tf:tfont;
      lf:TLogFont;
    begin
      tf := TFont.Create;
      tf.Assign(Canvas.Font);
      GetObject(tf.handle,sizeof(lf),@lf);
      lf.lfEscapement := 900;
      lf.lfOrientation := 900;
      tf.Handle := CreateFontIndirect(lf);
      Canvas.Font.Assign(tf);
      tf.Free;
      canvas.TextOut(200,200,'Hello!')
    end;
    旋转90度是900,180度是1800;
      

  5.   

    delphi 6效果百例中也有旋转详细的解释