📄 vc++ gdi+编程的字体和文本绘制_1.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0056)http://www.51it.org/kaifa/dotnet/vcnet/200508/27034.html -->
<HTML><HEAD><TITLE>VC++ GDI+编程的字体和文本绘制</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content=VC++ name=keywords GDI+编程的字体和文本绘制>
<META content=无忧IT网是国内成立较早的一个专业的计算机资源、建站资料下载站,主要提供建站资源下载、技术文章、工具下载、网页素材、网页特效、网页图
name=description GDI+编程的字体和文本绘制 资源。VC++
库等资源下载服务。在成立的近两年里,为近百万的站长提供了各类资源下载共计500多万次,每天有近两万的用户从我们的网站得到各类建站>
<META
onmouseover="self.status='为您提供丰富的编程开发技术文章! www.51it.org!';return true"><LINK
href="VC++ GDI+编程的字体和文本绘制_1.files/Skin5.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY leftMargin=0 topMargin=0>
<TABLE class=main cellSpacing=0 cellPadding=2 width=778 align=center
bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD vAlign=center align=middle height=71><IFRAME name=head marginWidth=0
marginHeight=0 src="VC++ GDI+编程的字体和文本绘制_1.files/top1.htm" frameBorder=0
width=772 scrolling=no height=232></IFRAME></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=778 align=center border=0>
<TBODY>
<TR>
<TD id=MyPath style="PADDING-LEFT: 5px" height=30><IMG
src="VC++ GDI+编程的字体和文本绘制_1.files/patht.gif"
align=absMiddle>您现在的位置: <A class=LinkPath
href="http://www.51it.org/">无忧IT网</A> >> <A class=LinkPath
href="http://www.51it.org/kaifa/Index.html">软件开发</A> >> <A
class=LinkPath
href="http://www.51it.org/kaifa/dotnet/Index.html">.NET开发</A> >> <A
class=LinkPath
href="http://www.51it.org/kaifa/dotnet/vcnet/Index.html">VC++.NET</A> >> 文章正文</TD></TR>
<TR>
<TD id=MyPath style="PADDING-LEFT: 5px" align=middle height=30>
<SCRIPT type=text/javascript>
<!--
google_ad_client = "pub-4804917193579738";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="0044983890";
//--></SCRIPT>
<SCRIPT src="VC++ GDI+编程的字体和文本绘制_1.files/show_ads.js"
type=text/javascript>
</SCRIPT>
</TD></TR></TBODY></TABLE>
<TABLE class=main cellSpacing=3 cellPadding=0 width=778 align=center
bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD vAlign=top width=*><!--网页中部左栏文章内容代码开始-->
<TABLE class=main_tdbg_575 style="WORD-BREAK: break-all" cellSpacing=0
cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR vAlign=center align=middle>
<TD colSpan=2 height=48><B><FONT color=#006699 size=3>VC++
GDI+编程的字体和文本绘制</FONT></B></TD></TR>
<TR vAlign=center align=middle bgColor=#f8f8f8>
<TD style="WORD-BREAK: break-all" colSpan=2 height=10></TD></TR>
<TR align=middle bgColor=#eeeeee>
<TD colSpan=2 height=28><A href="http://www.51it.org/"
target=_blank>无忧IT网 - 软件开发</A> ( 日期:2005-8-16) </TD></TR>
<TR>
<TD background="VC++ GDI+编程的字体和文本绘制_1.files/ad_bx1.gif" colSpan=2
height=6></TD></TR>
<TR>
<TD align=middle colSpan=2>
<SCRIPT type=text/javascript>
<!--
google_ad_client = "pub-4804917193579738";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
google_ad_channel ="7922498697";
//--></SCRIPT>
<SCRIPT src="VC++ GDI+编程的字体和文本绘制_1.files/show_ads.js"
type=text/javascript>
</SCRIPT>
</TD></TR>
<TR>
<TD id=content vAlign=top colSpan=2 height=50>
<P></P><BR><BR> 字体是文字显示和打印的外观形式,它包括了文字的字样、风格和尺寸等多方面的属性。适当地选用不同的字体,可以大大地丰富文字的外在表现力。例如,把文字中某些重要的字句用较粗的字体显示,能够体现出突出、强调的意图。当然,文本输出时还可使用其格式化属性和显示质量来优化文本显示的效果。<BR> <B>字体属性和字体创建</B><BR><BR> 字体的属性有很多,这里主要介绍字样、风格和尺寸三个主要属性。<BR><BR> 字样是字符书写和显示时表现出的特定模式,例如,对于汉字,通常有宋体、楷体、仿宋、黑体、隶书以及幼圆等多种字样。GDI+是通过FontFamily类来定义字样的,例如下面的代码:<BR><BR>FontFamily
fontFamily(L"幼圆"); //
定义"幼圆"字样<BR> 字体风格主要表现为字体的粗细和是否倾斜等特点。GDI+为用户提供了一些预定义的字体风格:FontStyleRegular(正常)、FontStyleBold(加粗)、FontStyleItalic(斜体)、FontStyleBoldItalic
(粗斜体)、FontStyleUnderline(下划线)和FontStyleStrikeout(删除线)。<BR><BR> 字体尺寸是用来指定字符所占区域的大小,通常用字符高度来描述。字体尺寸可以取毫米或英寸作为单位,但为了直观起见,也常常采用一种称为点的单位,一点约折合为1/72英寸。对于汉字,还常用号数来表示字体尺寸,初号字最大,以下依次为小初、一号、小一、二号、小二??,如此类推,字体尺寸起来越小。GDI+为用户提供了UnitDisplay(1/75英寸)、UnitPixel(像素)、UnitPoint(点)、UnitInch(英寸)、UnitDocument(1/300英寸)、UnitMillimeter(毫米)等字体尺寸单位。<BR><BR> 使用GDI+中的Font类,可以直接通过构造函数创建一个字体对象,例如下列代码:<BR><BR>Font
font(&fontFamily, 12, FontStyleRegular,
UnitPoint);<BR> 构造函数的第一个参数是用来指定FontFamily类对象指针,第二参数是用来指定字体的尺寸,它的实际大小取决于第四个参数所指定的尺寸单位。第三个参数用来指定字体风格。<BR><BR> 为了与原来的GDI字体相兼容,Font的构造函数还有另外一种型式:<BR><BR>Font(
HDC hdc, const LOGFONTW*
logfont)<BR> 其中,hdc是用来指定一个窗口的设备环境句柄,logfon是指向LOGFONT(逻辑字体)数据结构的指针。<BR><BR>
<P></P>
<P></P>
<P></P>
<P align=center><B><FONT color=red>[1]</FONT> <A
href="http://www.51it.org/kaifa/dotnet/vcnet/200508/27034_2.html">[2]</A> <A
href="http://www.51it.org/kaifa/dotnet/vcnet/200508/27034_3.html">[3]</A> <A
href="http://www.51it.org/kaifa/dotnet/vcnet/200508/27034_2.html">下一页</A> </B></P>
<P></P></TD></TR>
<TR vAlign=center bgColor=#f5f5f5>
<TD align=right colSpan=2 height=30>作者:YeskyADD… - 来源:网络收集</TD></TR>
<TR>
<TD>
<TABLE class=border cellSpacing=2 cellPadding=0 width="95%"
align=center bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD vAlign=top bgColor=#ffffff height=2></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="98%" align=center
border=0>
<TBODY>
<TR>
<TD style="PADDING-LEFT: 5px; BORDER-BOTTOM: #cccccc 1px solid"
vAlign=center align=left bgColor=#f8f8f8 height=25>
<LI>
<LI>上一篇文章: <A class=LinkPrevArticle
title="文章标题:Visual C++.NET GDI+编程基础 作 者:YeskyADDING 更新时间:2005-8-16 1:49:36"
href="http://www.51it.org/kaifa/dotnet/vcnet/200508/27033.html">Visual C++.NET GDI+编程基础</A></LI></TD></TR>
<TR>
<TD style="PADDING-LEFT: 5px" vAlign=center align=left
bgColor=#f9f9f9 height=25>
<LI>
<LI>下一篇文章: <A class=LinkNextArticle
title="文章标题:基于VC.NET的GDI+图像处理 作 者:YeskyADding 更新时间:2005-8-16 1:49:44"
href="http://www.51it.org/kaifa/dotnet/vcnet/200508/27035.html">基于VC.NET的GDI+图像处理</A></LI></TD></TR></TBODY></TABLE></TD></TR>
<TR class=left_tdbgall align=middle>
<TD colSpan=2 height=24>
<TABLE class=border cellSpacing=2 cellPadding=0 width="95%"
align=center bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD vAlign=top bgColor=#ffffff height=2><IFRAME marginWidth=0
marginHeight=0 src="VC++ GDI+编程的字体和文本绘制_1.files/CAUFO96F.htm"
frameBorder=0 width=570 scrolling=no
height=95><SCRIPT LANGUAGE="JavaScript1.1" SRC="http://iplus.allyes.com/main/adfshow?user=redvip|51it|51it_10052&db=iplus&local=yes&js=on"></SCRIPT><NOSCRIPT><A HREF="http://iplus.allyes.com/main/adfclick?user=redvip|51it|51it_10052&db=iplus"><IMG SRC="http://iplus.allyes.com/main/adfshow?user=redvip|51it|51it_10052&db=iplus" WIDTH=570 HEIGHT=95 BORDER=0></a></NOSCRIPT></IFRAME></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="98%" align=center
border=0>
<TBODY>
<TR>
<TD id=nav align=middle
background="VC++ GDI+编程的字体和文本绘制_1.files/lefttitlebg.gif"
height=30 border="0"><B>相关阅读</B></TD></TR>
<TR>
<TD class=SoftViewHotList>
<LI><A class=LinkArticleCorrelative
title="文章标题:Windows下PHP5和Apache的安装与配置 作 者:Blogmylxiaoyi 更新时间:2005-8-16 2:27:46"
href="http://www.51it.org/kaifa/web/php/200508/28097.html">Windows下PHP5和Apache的</A><BR>
<LI><A class=LinkArticleCorrelative
title="文章标题:PHP 5.0 中的对象重载技术研究 作 者:Yesky 更新时间:2005-8-16 2:27:46"
href="http://www.51it.org/kaifa/web/php/200508/28096.html">PHP 5.0 中的对象重载技</A><BR>
<LI><A class=LinkArticleCorrelative
title="文章标题:使用开源软件Lilina构建RSS聚合器 作 者:Yesky维维 更新时间:2005-8-16 2:27:41"
href="http://www.51it.org/kaifa/web/php/200508/28095.html">使用开源软件Lilina构建</A><BR>
<LI><A class=LinkArticleCorrelative
title="文章标题:PHP实现网页自动更新块 作 者:Yesky陈新征 更新时间:2005-8-16 2:27:41"
href="http://www.51it.org/kaifa/web/php/200508/28094.html">PHP实现网页自动更新块</A><BR>
<LI><A class=LinkArticleCorrelative
title="文章标题:PHP实现自动刷数和“灌水”机 作 者:Blogcqfz 更新时间:2005-8-16 2:27:41"
href="http://www.51it.org/kaifa/web/php/200508/28093.html">PHP实现自动刷数和“灌水</A><BR>
<LI><A class=LinkArticleCorrelative
title="文章标题:Php高手带路--问题汇总解答[2] 作 者:php联盟xltxlm 更新时间:2005-8-16 2:27:41"
href="http://www.51it.org/kaifa/web/php/200508/28092.html">Php高手带路--问题汇总解</A><BR>
<LI><A class=LinkArticleCorrelative
title="文章标题:PHP:404错误陷阱并email给管理员的程序 作 者:ChinaZ.com无从考证 更新时间:2005-8-16 2:27:40"
href="http://www.51it.org/kaifa/web/php/200508/28091.html">PHP:404错误陷阱并email</A><BR>
<LI><A class=LinkArticleCorrelative
title="文章标题:Php高手带路--问题汇总解答 作 者:php联盟xltxlm 更新时间:2005-8-16 2:27:40"
href="http://www.51it.org/kaifa/web/php/200508/28090.html">Php高手带路--问题汇总解</A><BR>
<LI><A class=LinkArticleCorrelative
title="文章标题:一个简单的php在线端口扫描器 作 者:php联盟angel 更新时间:2005-8-16 2:27:39"
href="http://www.51it.org/kaifa/web/php/200508/28089.html">一个简单的php在线端口扫</A><BR>
<LI><A class=LinkArticleCorrelative
title="文章标题:将PHP作为Shell脚本语言使用 作 者:PHPBuilderDarrell Brogdon 更新时间:2005-8-16 2:27:39"
href="http://www.51it.org/kaifa/web/php/200508/28088.html">将PHP作为Shell脚本语言</A><BR></LI></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><!--网页中部左栏文章内容代码结束-->
<TABLE style="BORDER-TOP: #cccccc 1px solid" cellSpacing=0 cellPadding=0
width="98%" align=center border=0>
<TBODY>
<TR>
<TD style="PADDING-LEFT: 5px" align=left bgColor=#f8f8f8
height=26>搜索更多与<FONT color=#ff0000><A
href="http://www.51it.org/search.asp?keyword=VC++ GDI+编程的字体和文本绘制"
target=_blank>VC++
GDI+编程的字体和文本绘制</A></FONT>相关的文章</TD></TR></TBODY></TABLE></TD>
<TD class=left_tdbgall vAlign=top width=190 bgColor=#00cccc height=400>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD id=nav align=middle
background="VC++ GDI+编程的字体和文本绘制_1.files/lefttitlebg.gif" colSpan=2
height=30 border="0">站内搜索</TD></TR>
<FORM name=s action=/Search.asp method=get target=_blank>
<TR>
<TD vAlign=center align=right width="70%" height=35><INPUT class=pt9
id=q
style="BORDER-RIGHT: #819cb9 1px solid; BORDER-TOP: #819cb9 1px solid; BORDER-LEFT: #819cb9 1px solid; BORDER-BOTTOM: #819cb9 1px solid"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -