MFC 写艺术字
来源:互联网 发布:qemu使用教程 windows 编辑:程序博客网 时间:2024/06/02 22:12
//艺术字体
void CGameScore::DrawTextString(CD3DDevice * pD3DDevice, LPCTSTR pszString, D3DCOLOR crText, D3DCOLOR crFrame, LPRECT lpRect,UINT nFormat)
{
//定义字体
CD3DFont escapeFont;
escapeFont.CreateFont(130, TEXT("宋体"), 1L);
//变量定义
INT nXExcursion[8]={1,1,1,0,-1,-1,-1,0};
INT nYExcursion[8]={-1,0,1,1,1,0,-1,-1};
//绘画边框
for (INT i=0;i<CountArray(nXExcursion);i++)
{
//计算位置
CRect rcFrame;
rcFrame.top=lpRect->top+nYExcursion[i];
rcFrame.left=lpRect->left+nXExcursion[i];
rcFrame.right=lpRect->right+nXExcursion[i];
rcFrame.bottom=lpRect->bottom+nYExcursion[i];
//绘画字符
escapeFont.DrawText(pD3DDevice,pszString,&rcFrame,nFormat,crFrame);
}
//绘画字符
escapeFont.DrawText(pD3DDevice,pszString,lpRect,nFormat,crText);
escapeFont.DeleteFont();
return;
void CGameScore::DrawTextString(CD3DDevice * pD3DDevice, LPCTSTR pszString, D3DCOLOR crText, D3DCOLOR crFrame, LPRECT lpRect,UINT nFormat)
{
//定义字体
CD3DFont escapeFont;
escapeFont.CreateFont(130, TEXT("宋体"), 1L);
//变量定义
INT nXExcursion[8]={1,1,1,0,-1,-1,-1,0};
INT nYExcursion[8]={-1,0,1,1,1,0,-1,-1};
//绘画边框
for (INT i=0;i<CountArray(nXExcursion);i++)
{
//计算位置
CRect rcFrame;
rcFrame.top=lpRect->top+nYExcursion[i];
rcFrame.left=lpRect->left+nXExcursion[i];
rcFrame.right=lpRect->right+nXExcursion[i];
rcFrame.bottom=lpRect->bottom+nYExcursion[i];
//绘画字符
escapeFont.DrawText(pD3DDevice,pszString,&rcFrame,nFormat,crFrame);
}
//绘画字符
escapeFont.DrawText(pD3DDevice,pszString,lpRect,nFormat,crText);
escapeFont.DeleteFont();
return;
}
说明:
这个函数的使用是给写的字进行描边,实现字体的美化,描边的方法,对坐标的往周围8个方向移动。
0 0
- MFC 写艺术字
- 艺术字代码
- 巧用CSS制作艺术字
- WORD 文档中的艺术字
- Office集成之“艺术字”
- C#制作 艺术字
- C#制作 艺术字
- C#设计制作艺术字
- PS制作艺术字
- C_艺术字编写
- 用C#制作艺术字
- C# 制作 艺术字
- Android中添加艺术字
- 【Unity3D ugui】使用艺术字
- 【Unity3D ugui】使用艺术字
- 在线生成ASCII艺术字
- 火焰艺术字效果制作
- 利用photoshop设计艺术字
- java 把已知下载路径的文件复制到本地
- 娜姐退役信
- 存储管理方法详解
- 深入浅出之正则表达式(二)
- [文件系统]Inotify机制介绍
- MFC 写艺术字
- MKNetworkKit入门和简单使用及其源码实例分析
- 白盒测试之语句覆盖
- 娜姐退役信(英文)
- Windows Server 2008 中的服务器安全策略管理
- A quick message queue benchmark: ActiveMQ, RabbitMQ, HornetQ, QPID, Apollo
- asp.net中c# byte[] 转换为 IntPtr几种方法
- int数组默认初始化值
- js写基本的时钟