Delphi利用Windows GDI实现文字倾斜
procedure TForm1.FormPaint(Sender: TObject);
var
FLogFont: tagLogFontW;
hTempFont, hPrevFont: HFONT; //字体句柄
hTempDC: HDC; //设备描述表或图形设备句柄
TempString: string; //输出的文字
begin
FLogFont.lfHeight := 10; //字高
FLogFont.lfWidth := 10; //字宽
FLogFont.lfWeight := 1; //字体笔划粗细程度
FLogFont.lfUnderline := 0; //没有下划线
FLogFont.lfStrikeOut := 0; //没有删除线
FLogFont.lfItalic := 0; //斜体效果否
FLogFont.lfCharSet := GB2312_CHARSET; //字符集
FLogfont.lfEscapement := 450; //倾斜度
// FLogFont.lfOrientation := 450; //方向与倾斜度取值同
FLogFont.lfFaceName := '宋体';//字体名称
//创建逻辑字体
hTempFont := CreateFontIndirect(FLogFont);
TempString := '测试';
hTempDC := GetDC(Handle); //取出窗口设备的当前字体,并替换为新字体
hPrevFont := SelectObject(hTempDC, hTempFont);//设置设备窗口的文字色彩
SetTextColor(hTempDc, clRed);
TextOut(hTempDc, 200 , 200, PChar(TempString), Length(TempString));
SelectObject(hTempDc, hPrevFont);
DeleteObject(hTempFont);
ReleaseDC(Handle, hTempDC);
end;
最新文章
- 【原创】android内存管理-内存泄漏原因
- 解决iPhone中overflow:scroll;滑动速度慢或者卡的问题
- MySQL性能优化的最佳20+条经验(转)
- Android开发之异步通信Handler机制
- 自定义手势_GestureOverlayVIew
- 16个最棒的jQuery视差滚动效果教程
- [转] Understanding Twitter Bootstrap 3
- Struts2命令空间小结
- JMeter性能测试,完整入门篇
- solr索引库的创建
- CDH5.16.1启动报错:Invalid value set for db.setupType, the valid values are EMBEDDED or EXTERNAL
- LeetCode - Subarray sum equals k
- 使用miniconda创建python虚拟环境
- 对象转Json时,Date类型格式化问题
- //{{AFX_MSG、//{{AFX_VIRTUAL、//{{AFX_MSG_MAP、//{{AFX_DATA_INIT
- HDOJ1008
- java判断字符串中是否含有中文
- vue向路由组件传递props
- Activity及Intent
- Unity3D研究院之DontDestroyOnLoad的坑
热门文章
- java oop第15章_Socket网络编程
- 软工-五月心得体会 PB16110698
- python 对象的删除
- Android SDK中无法安装HAXM installer
- 使用ribbon实现负载均衡
- 论文阅读笔记:《Interconnected Question Generation with Coreference Alignment and Conversion Flow Modeling》
- Foxmail公司邮箱配置
- 物理像素,逻辑像素,解决1px的问题
- CF755G PolandBall and Many Other Balls/soj 57送饮料
- EF批量添加