首页 > 代码库 > C++ Brush

C++ Brush

 

 

 

关键点

 

 

实现过程

 

 

void CCreateBrushView::OnDraw(CDCpDC)
{
    CCreateBrushDocpDoc = GetDocument();
    ASSERT_VALID(pDoc);
    //创建画刷方法1;
    LOGBRUSH lb;
    lb.lbStyle =BS_HATCHED;
    lb.lbColor=(COLORREF)0x00FF0000;
    lb.lbHatch=HS_CROSS;
    CBrush NewBrush1;
    NewBrush1.CreateBrushIndirect(&lb);
    CBrushpOldBrush1=pDC->SelectObject(&NewBrush1);
    pDC->Rectangle(50,50,200,300);
    pDC->SelectObject(pOldBrush1);
    //创建画刷方法2;
    CBrush NewBrush2((COLORREF)0x0000FF00);
    CBrushpOldBrush2=pDC->SelectObject(&NewBrush2);
    pDC->Rectangle(250,50,400,300);
    pDC->SelectObject(pOldBrush2);
    //创建画刷方法3;
    CBrush NewBrush3(HS_BDIAGONAL,(COLORREF)0x000000FF);
    CBrushpOldBrush3=pDC->SelectObject(&NewBrush3);
    pDC->Rectangle(450,50,600,300);
    pDC->SelectObject(pOldBrush3);

}

 

 

   


 

备注

 

 

相关链接

                           

 

 


来自为知笔记(Wiz)