📄 index037.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">如何在OLE控件中使用OLE_COLOR数据类型</font></td></tr>
<tr><td><p>
</Br>
诸如COleControl : : GetFortColor和COleControl : : GetBackColor等函数返回OLE _COLOR数据类型的颜色,而GDI对象诸如笔和刷子使用的是COLORREF数据类型,调用COleControl : : TranslateColor可以很容易地将OLE_COLOR类型改为COLORREF类型。下例创建了一个当前背景颜色的刷子:<Br>
</Br>
void CSampleControl : : OnDraw (CDC* pdc<Br>
const Crect& rcBounds , const Crect& rcInvalid<Br>
)<Br>
{<Br>
//Create a brush of the cuttent background color.<Br>
CBrush brushBack (TranslateColor (GetBackColor () ) )<Br>
</Br>
//Paint the background using the current backgroundcolor .<Br>
pdc—> FilllRect (rcBounds , &brushBack)<Br>
</Br>
//other drawign commands<Br>
</Br>
…<Br>
}<Br>
</Br>
</p></td></tr>
</table>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -