📄 index049.htm
字号:
<html>
<style type="text/css"><!--
.p9 { font-family: "宋体"; font-size: 9pt}a {text-transform: none; text-decoration: none;}
a:hover {text-decoration: underline; color: #FF0000;}
--></style>
<body background="../di2001.jpg">
<h3 align="center"><font COLOR="#AOAO99"></font></h3>
<table width="100%" border="1" cellspacing="1">
<tr><td><p align="center"><font color="#FF0000">如何获取GDI对象的属性信息</font></td></tr>
<tr><td><p>
</Br>
可以调用GDIObject:: GetObject。这个函数将指定图表设备的消息写入到缓冲区。下例创建了几个有用的辅助函数。<Br>
//Determine if font is bold.<Br>
BOOL IsFontBold (const CFont&font)<Br>
{<Br>
LOGFONT stFont<Br>
font.GetObject (sizeof (LOGFONT), &stFont)<Br>
return (stFont.lfBold)? TRUE: FALSE<Br>
}<Br>
</Br>
//Return the size of a bitmap.<Br>
CSize GetBitmapSize (const CBitmap&bitmap)<Br>
{<Br>
BITMAP stBitmap<Br>
bitmap.GetObject (sizeof (BITMAP), &stBitmap)<Br>
return CSize (stBitmap.bmWidth, stBitmap.bmHeight)<Br>
}<Br>
</Br>
//Create a pen with the same color as a brush.<Br>
BOOL CreatePenFromBrush (Cpen&pen, cost Cbrush&brush)<Br>
{<Br>
LOGBRUSH stBrush<Br>
brush.Getobject (sizeof (LOGBRUSH), &stBrush)<Br>
return pen. Createpen (PS_SOLID, 0, stBrush.ibColor)<Br>
}<Br>
</Br>
</p></td></tr>
</table>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -