bestlong 怕失憶論壇

標題: 取得文字的字型之寬與高的像素數 [打印本頁]

作者: bestlong    時間: 2007-10-20 09:34     標題: 取得文字的字型之寬與高的像素數

  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   Label1.Caption := 'Width is ' + IntToStr(Form1.Canvas.TextWidth(Edit1.Text)) + ' pixels';
  4.   Label2.Caption := 'Height is ' +IntToStr(Form1.Canvas.TextHeight(Edit1.Text)) + ' pixels';;
  5. end;
複製代碼





歡迎光臨 bestlong 怕失憶論壇 (http://www.bestlong.idv.tw/) Powered by Discuz! X1.5