zoukankan      html  css  js  c++  java
  • HOLLOW_BRUSH等价于NULL_BRUSH,都代表透明化刷

    NULL_BRUSH 或HOLLOW_BRUSH和GetStockObject函数

    备注:HOLLOW_BRUSH等价于NULL_BRUSH,都代表透明化刷

    HGDIOBJ GetStockObject( __in  int fnObject)
        参数:fnObject代表笔或者刷的类型,可以参看MSDN

    返回值:返回一个GDIOBJ对象的句柄。根据需要转换成笔/刷的句柄,

    如:HBRUSH(GetStockObject(HOLLOW_BRUSH));

    实例应用:一个透明的背景的编辑框

    HBRUSH CBackimageDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)

    {     

           HBRUSH hbr =CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

           switch(nCtlColor)             

           {            

           case CTLCOLOR_STATIC: //对所有静态文本控件的设置            

                  {                   

                         pDC->SetBkMode(TRANSPARENT);//设置背景为透明                                        pDC->SetTextColor(RGB(0,0,0)); //设置字体颜色                  

                         returnHBRUSH(GetStockObject(HOLLOW_BRUSH)); // 必须                    

                  }            

           case CTLCOLOR_EDIT:  //对所有编辑框控件的设置

                  {                   

                         pDC->SetBkMode(TRANSPARENT);//设置背景为透明                                   pDC->SetTextColor(RGB(0,0,0)); //设置字体颜色                  

                         returnHBRUSH(GetStockObject(HOLLOW_BRUSH)); // 必须                    

                  }     

           default:        

                  returnCDialog::OnCtlColor(pDC,pWnd, nCtlColor);        

           }     

           return hbr;  

    }

    效果:

    http://blog.csdn.net/qq2399431200/article/details/10991917

  • 相关阅读:
    beaglebone black教程1-ssh登录和新建一个账户
    入职南大富士通一周感想
    stm32的内存分配以及text、bss、data段的意思
    初识modbus
    使用github上面别人的pyqt4+pyserial代码的时遇到的问题
    在MDK V5.12.0环境下建立2440的裸机开发环境
    Eclipse 插件
    Using Notepad++ To Quickly Format XML
    批处理检测外部命令是否存在的模块
    springside4
  • 原文地址:https://www.cnblogs.com/findumars/p/6569300.html
Copyright © 2011-2022 走看看