Windows预定义阴影画刷学习

画刷是一个8*8位图;用来重复填充区域内部;

有实心和阴影画刷;实心就是SolidBrush;

有6种预定义阴影画刷;

void CHatchdemoView::OnDraw(CDC* pDC)
{
	CHatchdemoDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
	CRect rect1(40, 40, 200, 200);
	CBrush brush1;
	
	brush1.CreateHatchBrush(HS_BDIAGONAL, RGB(0, 255,0));
	pDC->FillRect(rect1, &brush1);
	rect1.OffsetRect(210,0);
	brush1.CreateHatchBrush(HS_CROSS, RGB(0, 255,0));
	pDC->FillRect(rect1, &brush1);
	rect1.OffsetRect(210,0);
	brush1.CreateHatchBrush(HS_DIAGCROSS, RGB(0, 255,0));
	pDC->FillRect(rect1, &brush1);
	rect1.OffsetRect(-210*2,210);
	brush1.CreateHatchBrush(HS_FDIAGONAL, RGB(0, 255,0));
	pDC->FillRect(rect1, &brush1);
	rect1.OffsetRect(210,0);
	brush1.CreateHatchBrush(HS_HORIZONTAL, RGB(0, 255,0));
	pDC->FillRect(rect1, &brush1);
	rect1.OffsetRect(210,0);
	brush1.CreateHatchBrush(HS_VERTICAL, RGB(0, 255,

你可能感兴趣的:(VC++,图形学和3D,windows,画刷,GDI)