首页 > 代码库 > C++ Brush
C++ Brush
关键点
实现过程
void CCreateBrushView::OnDraw(CDC* pDC) { CCreateBrushDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); //创建画刷方法1; LOGBRUSH lb; lb.lbStyle =BS_HATCHED; lb.lbColor=(COLORREF)0x00FF0000; lb.lbHatch=HS_CROSS; CBrush NewBrush1; NewBrush1.CreateBrushIndirect(&lb); CBrush* pOldBrush1=pDC->SelectObject(&NewBrush1); pDC->Rectangle(50,50,200,300); pDC->SelectObject(pOldBrush1); //创建画刷方法2; CBrush NewBrush2((COLORREF)0x0000FF00); CBrush* pOldBrush2=pDC->SelectObject(&NewBrush2); pDC->Rectangle(250,50,400,300); pDC->SelectObject(pOldBrush2); //创建画刷方法3; CBrush NewBrush3(HS_BDIAGONAL,(COLORREF)0x000000FF); CBrush* pOldBrush3=pDC->SelectObject(&NewBrush3); pDC->Rectangle(450,50,600,300); pDC->SelectObject(pOldBrush3); } |
图
备注
相关链接
来自为知笔记(Wiz)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。