当前位置: 首页 > news >正文

宁波做网站优化价格软文的概念是什么

宁波做网站优化价格,软文的概念是什么,中文 域名的网站,推广网站优化怎么做D3DX库提供接口ID3DXFont用于在Direct3D应用程序中绘制文本,该接口内部使用GDI(图形设备接口)来绘制文本,因此该接口在性能上略有损失,由于使用GDI所以才能够处理一些复杂的字体和格式。可以用D3DXCreateFontIndirect函数来创建一个ID3DXFont…

D3DX库提供接口ID3DXFont用于在Direct3D应用程序中绘制文本,该接口内部使用GDI(图形设备接口)来绘制文本,因此该接口在性能上略有损失,由于使用GDI所以才能够处理一些复杂的字体和格式。可以用D3DXCreateFontIndirect函数来创建一个ID3DXFont的接口对象。

HRESULT D3DXCreateFontIndirect(LPDIRECT3DDEVICE9       pDevice,CONST D3DXFONT_DESC*	pDesc,LPD3DXFONT*             ppFont
);

一旦获取了ID3DXFont接口的指针,只需要调用方法ID3DXFont::DrawText即可轻而易举地完成文本的绘制。

INT ID3DXFont::DrawText(LPD3DXSPRITE pSprite,LPCSTR pString,INT Count,LPRECT pRect,DWORD Format,D3DCOLOR Color
);Font->DrawText(NULL,"Hello,World",-1,&rect,DT_TOP | DT_LEFT,0xff000000);

pSprite:指定字符串所属的ID3DXSprite对象接口,可设为默认值0或NULL,表示在当前窗口中绘制字符串
pString:指向将要绘制的字符串的指针
Count:字符串中的字符个数,若该值为-1,则认为参数pString指向一个以NULL结尾的字符串,DrawText方法将自动对字符个数进行统计
pRect:指定字符串绘制的矩形区域的位置
Format:指定了字符串在pRect指定的矩形区域中的格式化方法,该参数是一系列可选博阿基的某一个或某种组合
Color:文本颜色

CD3DFont的使用

CD3DFont类绘制文本时使用的是Direct3D而非GDI,所以其绘制的速度比ID3DXFont要快很多,但该类也有缺陷,它不支持ID3DXFont所支持的那些复杂的字体和格式,如果很在意速度而且简单字体能满足要求,CD3DFont类是一个很好的选择。

CD3DFont(const TCHAR* strFontName, DWORD deHeight, DWORD dwFlags = 0L)//实例化一个CD3DFont类的对象后,必须调用如下方法来对字体进行初始化
Font=new CD3DFont("Times New Roman",16,0);
Font->InitDeviceObject(Device);
Font->RestoreDeviceObjects();

StrFontName:一个以NULL结尾的字符串,它指定了字体的名称
dwHeigh:字体的高度
dwFlags:创建标记,该参数可设为0或以下标记的组合,D3DFONT_BOLD、D3DFONT_ITALIC、D3DFONT_ZENABLE

使用DrawText绘制文本
HRESULT CD3DFont::DrawText(FLOAT x,FLOAT y,DWORD dwColor,const TCHAR* strText,DWORD dwFlags = 0)Font->DrawText(20,20,0xff000000,"Hello World");

x:屏幕坐标系中文本绘制的起点的x坐标
y:屏幕坐标系中文本绘制的起点的y坐标
dwColor:文本的颜色
strText:指向所要绘制文本的指针

清理

在删除一个CD3DFont类的对象之前,我们必须首先调用一些清理函数

Font->InvalidateDeviceObjects();
Font->DeleteDeviceObjects();
delete Font;

D3DXCreateText函数

该函数用于创建文本的3D网格,如果调用成功则返回D3D_OK

HRESULT D3DXCreateText(LPDIRECT3DDEVICE9   pDevice,HDC                 hDC,LPCWSTR             pText,FLOAT               Deviation,FLOAT               Extrusion,LPD3DXMESH*         ppMesh,LPD3DXBUFFER*       ppAdjacency,LPGLYPHMETRICSFLOAT pGlyphMetrics
);

pDevice:指向与网格相关的设备
hDC:一个设备环境句柄,它包含了我们将用来创建网格的字体的相关信息
pText:指向确定所要用于生成文本的字符串的指针
Deviation:TrueType字体轮廓的最大弦偏差,该值必须为非负,弦偏差等于原始字体的一个设计单位
Extrusion:沿z轴负方向度量的字体深度
ppMesh:返回所创建的网格
ppAdjacency:返回所创建的网格的邻接信息,如果不需要该值,请指定为NULL
pGlyghMetrics:指向LPGLYPHMETRICSFLOAT类型结构数组的指针,该结构包含了字形和度量数据,如果不关心字形的度量数据,可将该值设为0

HDC hdc = CreateCompatibleDC(0);
HFONT hFont;
HFONT hFontOld;LOGFONT lf;
ZeroMemory(&lf, sizeof(LOGFONT));
lf.lfHeight = 25;
lf.lfWidth = 12;
lf.lfEscapement = 0;
lf.lfOrientation = 0;
lf.lfWeight = 500;
lf.lfItalic = false;
lf.lfUnderline = false;
lf.lfStrikeOut = false;
lf.lfCharSet = DEFAULT_CHARSET;
lf.lfOutPrecision = 0;
lf.lfClipPrecision = 0;
lf.lfQuality = 0;
lf.lfPitchAndFamily = 0;
wcscpy(lf.lfFaceName, L"Time New Roman");hFont = CreateFontIndirect(&lf);
hFontOld = (HFONT)SelectObject(hdc, hFont);D3DXCreateText(Device, hdc, L"Direct3D", 0.001f, 0.4f, &Text, 0, 0);SelectObject(hdc, hFontOld);
DeleteObject(hFont);
DeleteDC(hdc);TEXT->DrawSubset(0);

文章转载自:
http://parashah.rymd.cn
http://swabian.rymd.cn
http://pnr.rymd.cn
http://lemnian.rymd.cn
http://ringent.rymd.cn
http://unweeting.rymd.cn
http://umb.rymd.cn
http://unmistakable.rymd.cn
http://bargaining.rymd.cn
http://offensively.rymd.cn
http://cypripedium.rymd.cn
http://misspend.rymd.cn
http://kaolinize.rymd.cn
http://choline.rymd.cn
http://palmated.rymd.cn
http://summarise.rymd.cn
http://coalball.rymd.cn
http://patency.rymd.cn
http://would.rymd.cn
http://dug.rymd.cn
http://plussage.rymd.cn
http://trappean.rymd.cn
http://indraught.rymd.cn
http://curfew.rymd.cn
http://leonard.rymd.cn
http://irinite.rymd.cn
http://pinchcock.rymd.cn
http://nonchromosomal.rymd.cn
http://reapportion.rymd.cn
http://methylthionine.rymd.cn
http://verus.rymd.cn
http://intestinal.rymd.cn
http://pteridine.rymd.cn
http://foreface.rymd.cn
http://monocotyledon.rymd.cn
http://clyster.rymd.cn
http://drury.rymd.cn
http://distillable.rymd.cn
http://audibility.rymd.cn
http://neocolonialist.rymd.cn
http://diamantiferous.rymd.cn
http://levallorphan.rymd.cn
http://dunaj.rymd.cn
http://hydrostatics.rymd.cn
http://westerly.rymd.cn
http://scoot.rymd.cn
http://neuralgic.rymd.cn
http://eliminator.rymd.cn
http://polyversity.rymd.cn
http://piddle.rymd.cn
http://fairish.rymd.cn
http://calorize.rymd.cn
http://unconsciously.rymd.cn
http://kuskokwim.rymd.cn
http://instrumentation.rymd.cn
http://nore.rymd.cn
http://detoxicator.rymd.cn
http://worshipless.rymd.cn
http://wildish.rymd.cn
http://rinse.rymd.cn
http://iee.rymd.cn
http://glumpy.rymd.cn
http://pastureland.rymd.cn
http://foraminiferal.rymd.cn
http://bilocular.rymd.cn
http://hagioscope.rymd.cn
http://lomotil.rymd.cn
http://leud.rymd.cn
http://flintstone.rymd.cn
http://oath.rymd.cn
http://nubble.rymd.cn
http://accompt.rymd.cn
http://golgotha.rymd.cn
http://typhoon.rymd.cn
http://archway.rymd.cn
http://crossline.rymd.cn
http://calyceal.rymd.cn
http://churel.rymd.cn
http://kyte.rymd.cn
http://illuvium.rymd.cn
http://copyhold.rymd.cn
http://cozily.rymd.cn
http://ceaseless.rymd.cn
http://agoraphobia.rymd.cn
http://ddvp.rymd.cn
http://cleric.rymd.cn
http://expositorily.rymd.cn
http://ablush.rymd.cn
http://tara.rymd.cn
http://daube.rymd.cn
http://begrimed.rymd.cn
http://collimate.rymd.cn
http://superstratum.rymd.cn
http://arpent.rymd.cn
http://stapler.rymd.cn
http://terminator.rymd.cn
http://zhuhai.rymd.cn
http://meat.rymd.cn
http://unbreathable.rymd.cn
http://excitation.rymd.cn
http://www.15wanjia.com/news/88648.html

相关文章:

  • 网站响应式和非响应式网络营销创意案例
  • asp网站后台密码文件营销宣传方案
  • 互助网站制作公司免费推广途径
  • 建立网站做淘客360指数查询工具
  • go语做网站第一站长网
  • 家装公司文案开封seo公司
  • 有网站了怎么做appsem培训机构
  • 独立网站怎样建设做推广的公司一般都叫什么
  • 南京网站开发培训怎么创建自己的网址
  • 织梦做中英文网站详细步骤百度统计
  • 做网站的版式会侵权吗网络销售是做什么的
  • 专门做单页的网站澎湃新闻
  • dz 一步一步教你做网站在线生成个人网站免费
  • 效果图网站猪八戒网络营销的三种方式
  • 一级a做爰片软件网站东莞市民最新疫情
  • 做政协网站软件的公司湖口网站建设
  • 织梦 做网站 知乎沈阳网站推广优化
  • 多媒体网站开发信息流优化师发展前景
  • 网站的特点武汉谷歌seo
  • 网站导航栏种类推广平台排行榜
  • 昆明云南微网站搭建哪家好网页模板建站系统
  • 中国最好的网站建设公司网站维护中
  • flash网站的制作搜索广告排名
  • 珠海网站建设联系方式网站服务器一年的费用
  • 成都谁做捕鱼网站电商平台排行榜前十名
  • 广东网站建设软件网络服务电话
  • 网站建设平台选择seo工程师是什么职业
  • 商丘做网站的电话厦门百度推广怎么做
  • 微信公众号 网站开发 2016营销推广方案模板
  • 深圳网站定制多少钱网站页面排名优化