自定义行间距 多行输出 解决DrawText 无法自定义行间距的问题
来源:互联网 发布:人人商城数据库表 编辑:程序博客网 时间:2024/05/18 00:27
//nRowDis 行间距 strText 输出内容
void DrawMultLineText(CDC* pDC ,CRect rect, int nRowDis, UINT nFromat, CString strText) {if( strText.GetLength() <= 0 )return;WCHAR* pText = strText.GetBuffer();int nCount = strText.GetLength();CRect rtChar;CSize size = pDC->GetTextExtent(pText + 0, 1);int nRowHeight = size.cx + nRowDis;rtChar.top = rect.top;rtChar.left = rect.left;rtChar.bottom= rtChar.top + nRowDis + size.cy;rtChar.right= rtChar.left + size.cx;CString strChar;for (int nCharIndex = 0; nCharIndex < nCount; nCharIndex++){if( rtChar.right > rect.right ){rtChar.top = rtChar.bottom;rtChar.bottom += nRowHeight;size = pDC->GetTextExtent(pText + nCharIndex, 1);rtChar.left = rect.left;rtChar.right = rtChar.left + size.cx;if( rtChar.bottom > rect.bottom )break;}strChar = pText[nCharIndex];pDC->DrawText(strChar, rtChar, nFromat);size = pDC->GetTextExtent(pText + nCharIndex + 1, 1);rtChar.left = rtChar.right;rtChar.right += size.cx;}}
多行文本 自定义 行间距
- 自定义行间距 多行输出 解决DrawText 无法自定义行间距的问题
- 计算label自定义行间距字间距,计算自定义行间距字间距的高度
- [转]iOS UILabel自定义行间距时获取高度
- UILabel - 自定义行间距,字间距及段间距[并动态调节高度]
- easyui的自定义行工具栏
- iOS中求出label中文字的行数和每一行的内容,带自定义行间距
- 使用富文本在lable上展示不同颜色的文字,自定义label高度,自定义行间距
- GridView插入自定义行
- jqxGrid自定义行编辑器
- Dev GridControl 自定义行颜色
- 零件库的族添加自定义行
- DataGridView自定义行样式和行标题
- DataGridView自定义行样式和行标题
- DataGridView自定义行样式和行标题
- DataGridView 自定义行样式和行标题
- 自定义行转定函数wm_concat应用(PLS-00530)
- JSF中为dataTable组件指定自定义行样式
- Sybase15实现 自定义行转列函数
- 在 C# 中通过 P/Invoke 调用Win32 DLL
- Android中通过getSystemService取得服务
- 理解和使用Linux的硬件抽象层HAL
- 整理正则表达式
- Oracle awr 介绍
- 自定义行间距 多行输出 解决DrawText 无法自定义行间距的问题
- sizeof, strlen实例比较
- android 设置主题
- Android 有两种办法可以监控SDCARD的状态
- AIX 分页替换技术入门
- 不可不表的OSG智能指针之强指针与弱指针
- 采用PPPoE拨号+RADIUS验证的方式进行互联网接入管理
- WCF 服务器与客户端的配置
- 正则表达式限制文本框只能输入数字