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

  • 相关阅读:
    57. Insert Interval
    287. Find the Duplicate Number
    52. N-Queens II
    51. N-Queens
    151. Reverse Words in a String
    29. Divide Two Integers
    [POJ2104]K-th Number
    [JSOI2008]最大数
    [BZOJ3673&3674]可持久化并查集&加强版
    C++ STL rope介绍----可持久化平衡树
  • 原文地址:https://www.cnblogs.com/findumars/p/6569300.html
Copyright © 2011-2022 走看看