标  题: 如何在OLE控件中使用OLE_COLOR数据类型             
发信人: Pacific (无情~~~Nolove), 信区: VisualC
发信站: BBS 水木清华站 (Fri Oct 16 17:13:44 1998)


    诸如COleControl : : GetFortColor和COleControl : : GetBackColor等函数         
返回OLE _COLOR数据类型的颜色,而GDI对象诸如笔和刷子使用的是COLORREF数据类        
型,调用COleControl : : TranslateColor可以很容易地将OLE_COLOR类型改为            
COLORREF类型。下例创建了一个当前背景颜色的刷子:                                 
                                                                                 
void CSampleControl : : OnDraw (CDC* pdc                                         
    const Crect& rcBounds , const Crect& rcInvalid )                             
{                                                                                
    //Create a brush of the cuttent background color .                           
    CBrush brushBack (TranslateColor (GetBackColor ( ) ) );                      
                                                                                 
    //Paint the background using the current background color .                  
    pdc—> FilllRect  (rcBounds , &brushBack) ;                                  
                                                                                 
    //other drawign commands                                                     
                                                                                 
    …                                                                           
                                                                                 
}                                                                                

--
        老鸟有交待,中鸟要等待,菜鸟要忍耐。
        老鸟级功夫:吹牛、聊天、玩MUD 、发呆。
        中鸟级功夫:睡觉、灌水、玩游戏、NT&VC。
        菜鸟级功夫:学习、泡妞、玩篮球、And so on

        My E-Mail: Nolove@263.net

--
☆ 来源:.哈工大紫丁香 bbs.hit.edu.cn.[FROM: yazhou.bbs@bbs.net.t]
※ 修改:.fzx 于 Aug  9 16:51:07 修改本文.[FROM: heart.hit.edu.cn]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.107毫秒