Delphi 图形处理 技巧
来源:互联网 发布:江西省网络知识竞赛 编辑:程序博客网 时间:2024/06/10 19:38
1。得到输出字符串在 屏幕上的象素数。
BOOL GetTextExtentPoint32( HDC hdc, // handle of device context
LPCTSTR lpString, // address of text string
int cbString, // number of characters in string
LPSIZE lpSize // address of structure for string size
);
利用该函数 我们可以得到 字符串在屏幕上的 象素数。
应用举例:使不同长度字符串 输出时 右 对齐。
var
Str:String;
sizeFont:Size;
ndata:integer;
begin
str:='13456';
with Image1.Canvas do
begin
GetTextExtentPoint32(Image1.Canvas.Handle, PChar(str), Length(str), sizeFont);
TextOut(100 - sizeFont.cx,10,str);
str:='13456789';
GetTextExtentPoint32(Image1.Canvas.Handle, PChar(str), Length(str), sizeFont);
TextOut(100 - sizeFont.cx,30,str);
ndata:=-13456;
str:=Inttostr(ndata);
GetTextExtentPoint32(Image1.Canvas.Handle, PChar(str), Length(str), sizeFont);
TextOut(100 - sizeFont.cx,60,str);
end;
- Delphi 图形处理 技巧
- Delphi中的图形显示技巧
- Delphi中的图形显示技巧
- Delphi中的图形显示技巧
- Delphi GDI+ 图形处理(2)
- Delphi GDI+ 图形处理(3)
- Delphi GDI+ 图形处理(3)
- word中visio图形的处理技巧
- delphi, Mapobjects(mo)开发一些技巧,图形对象类型转换
- 利用Delphi为Visual C++添加JPEG图形处理功能
- Delphi的图形处理 之一 -- 图像处理在可视化编程中的作用及其应用价值
- Delphi技巧
- delphi技巧
- 图形图形处理技术
- Android绘图机制与处理技巧(四)Android图像处理之图形特效处理
- delphi图形设计
- 图形处理
- 图形处理
- Windflowers(歌词)
- 顶级CEO高效工作的6大秘诀
- ASP.NET如何存取SQL Server数据库图片2
- 字符串截取(C#)
- 使用links方式安装Eclipse插件
- Delphi 图形处理 技巧
- 中国计算机报-用友华表成功秘密
- 项目开始
- 昨天事情真多
- 2006世界杯32强
- 生成条形码
- JSP环境基于Session的在线用户统计深入分析
- BAT常用命令
- 昨天晚上在电影台看了《独自等待》