HRGN hrgn1 = CreateRectRgn(10, 10, 100, 100);//创建矩形区域 HRGN hrgn2 = CreateEllipticRgn(150, 150, 250, 250);//创建椭圆区域 HRGN hrgn= CreateRectRgn(0, 0, 0, 0); int n1=::CombineRgn(hrgn, hrgn1, hrgn2, RGN_OR); //将两个区域组合为一个新区域 HDC hdc = ::GetDC(m_hWnd); int n = SelectClipRgn(hdc, hrgn);//选择剪切区域 HBRUSH hbr = CreateSolidBrush(RGB(0, 0, 255)); //单色的画刷 BOOL b = FillRgn(hdc, hrgn, hbr); //用画刷填充区域 /* 参数1:HDC hdc 参数2:HRGN hrgn 区域 参数3:HBRUSH hbr 画刷 */ DeleteObject(hbr); DeleteObject(hrgn); ::ReleaseDC(m_hWnd, hdc);
标签:hrgn,FillRgn,用画,区域,hdc,GDI,HRGN,hbr From: https://www.cnblogs.com/liming19680104/p/17401669.html