渐变填充

一、通过划分成小个矩形进行渐变填充

在这里插入图片描述

	CRect rectangle;
	//分割客户区域成小矩形,逐个填充
	for (int i = x1; i < x2; i++)
	{
		rectangle.SetRect(i, y1, i + 1, y2);
		m_pDC->FillSolidRect(&rectangle, RGB(255, 255, 255 - MulDiv(i, 255, x2-x1)));
	}

猜你喜欢

转载自blog.csdn.net/weixin_43118073/article/details/105191204
今日推荐