Function GetTextWidth(ACanvas:TCanvas);
Begin
Result:=ACanvas.TextWidth('W');
End;Function GetTextHeight(ACanvas:TCanvas);
Bein
Result:=ACanvas.TextHeight('W');
End;
Begin
Result:=ACanvas.TextWidth('W');
End;Function GetTextHeight(ACanvas:TCanvas);
Bein
Result:=ACanvas.TextHeight('W');
End;
解决方案 »
- DELPHI2009中如何实现在系统任务栏隐藏窗口标题?
- 如何在delphi中透明显示有多个背景色的GIF文件??
- 为什么不能清空Edit1.Text
- 如过SQL数据库的信息如下,如何在SQLServer企业管理器中注册这个连接,求教?
- 急!如何精简BDE(VFP)?
- cannot perform this operation on a close dataset
- oracle中,设定varchar2长度为4000,(最大只能存4000),为什么存到1333就不行了,多一个都不行,报 ORA-01480:trailling missing from STR bin
- 请问如何使用 ADO 控件执行批量的 SQL 脚本(含有 GO命令的)?
- ===用QuickRpt打印大段文本时,怎么控制换行和行间距?===
- 怎么看昨天的文章阿?
- 怎样实现WAV<->MIDI的相互转换。
- 被同公司的女孩爱上了,干不了工作了,怎么办 ????
Begin
Result:=ACanvas.TextWidth('W');
End;Function GetTextHeight(ACanvas:TCanvas):Integer;
Bein
Result:=ACanvas.TextHeight('W');
End;
TextStr :PChar;
TextWidth:TPoint;
...
Begin
...
TextStr := PChar('好');
GetTextExtentPoint(Canvas.Handle, TextStr,StrLen(TextStr), TSize(TextWidth));
ShowMessage('宽度:'+IntToStr(TextWidth.X)+#13#10+_
'高度:'+IntToStr(TextWidth.Y));
...
End;
font的大小 以 磅记:1磅=1/72英寸;
font所占像素数:=round(font.pixelsPerInch*font.size/72);