c++ 通过SetPixel画背景图


void CSetPixelTestDlg::OnBnClickedButton1()
{
	// TODO: 在此添加控件通知处理程序代码
	CDC *pDC = GetDC();
	CRect rect;
	GetClientRect(&rect);
	for (size_t i = 0; i < rect.Width(); i++)
	{
		for (size_t j = 0; j < rect.Height(); j++)
		{

			SetPixel(pDC->m_hDC, i, j, RGB(255, 0, 0));
		}
	}
}

猜你喜欢

转载自blog.csdn.net/dxm809/article/details/113971566