在linux+kylix环境下画布上画旋转的字体

类别:编程语言 点击:0 评论:0 推荐:

 

unit Unit1;

interface

uses
  SysUtils, Types, Classes, Variants, QTypes, QGraphics, QControls, QForms,
  QDialogs, QStdCtrls, QExtCtrls,qt;

type
  TForm1 = class(TForm)
    ComboBox1: TComboBox;
    Edit1: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Button1: TButton;
    Bevel1: TBevel;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.xfm}

procedure TForm1.Button1Click(Sender: TObject);

var
 pxy,PrPoint:TPoint;
begin
pxy.x:=100;
pxy.y:=100;
canvas.Start(); //prevent other process using canvas
canvas.Font.Size:=40;
QPainter_rotate(Canvas.Handle,strtoint(ComboBox1.text));
QPainter_xFormDev(Canvas.Handle,PPoint(@prpoint),ppoint(@Pxy));
Canvas.TextOut(prpoint.x,prpoint.Y,Edit1.Text);
canvas.Stop;
//return to old position
QPainter_rotate(Canvas.Handle,strtoint(ComboBox1.text)*-1);
Canvas.TextOut(pxy.x,pxy.Y,Edit1.Text);
end;

end.

 

在RedHat9 kylix3.0下测试通过

........................................................................

欢迎和我交流 

费弘斌
qq:58055730
msn:[email protected]

http://www.codeidea.com

本文地址:http://com.8s8s.com/it/it27565.htm