GDI文字绘制和windows下opengl文字绘制小结

本文总结了Windows环境下GDI和OpenGL的文字绘制方法。在GDI中,通过设置font对象的nEscapement和nOrientation参数控制文字方向,而在OpenGL中,可以使用位图、3D轮廓或纹理来绘制字体,位图不能旋转缩放,而3D轮廓则允许自由变换。
摘要由CSDN通过智能技术生成

1.GDI绘制文字,要设置文字的属性,主要就是通过设置DC中的font对象来实现的。

font对象的创建可以由createfont()、createfontIndirect()来实现。

HFONT CreateFont(
	int nHeight,               // height of font
	int nWidth,                // average character width
	int nEscapement,           // angle of escapement
	int nOrientation,          // base-line orientation angle
	int fnWeight,              // font weight
	DWORD fdwItalic,           // italic attribute option
	DWORD fdwUnderline,        // underline attribute option
	DWORD fdwStrikeOut,        // strikeout attribute option
	DWORD fdwCharSet,          // character set identifier
	DWORD fdwOutputPrecision,  // output precision
	DWORD fdwClipPrecision,    // clipping precision
	DWORD fdwQuality,          // output quality
	DWORD fdwPitchAndFamily,   // pitch and family
	LPCTSTR lpszFace           // typeface name
	);

HFONT CreateFontIndirect( CONST LOGFONT* lplf // c
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值