void CGDIplus2Dlg::OnFillRegion()
{
CClientDC dc(&this->m_StaticWindow);
Graphics myGraphics(dc.m_hDC);
SolidBrush mySolidBrush(Color(255,255,0,0));
Rect rect(0,0,100,200);
Region myRegion(rect);
myGraphics.FillRegion(&mySolidBrush, &myRegion);
}
void CGDIplus2Dlg::OnSetClip()
{
CClientDC dc(&this->m_StaticWindow);
Graphics myGraphics(dc.m_hDC);
Pen myPen(Color(255,255,0,0),1);
Region myRegion(Rect(20, 30, 100, 50));
myGraphics.DrawRectangle(&myPen, 20, 30, 100, 50);
myGraphics.SetClip(&myRegion, CombineModeReplace);
myGraphics.DrawLine(&myPen, 0, 0, 200, 200);
{
CClientDC dc(this);
Graphics myGraphics(dc.m_hDC);
Pen myPen(Color(255,255,0,0),1);
Region myRegion(Rect(20, 30, 100, 50));
myGraphics.DrawRectangle(&myPen, 20, 30, 100, 50);
//myGraphics.SetClip(&myRegion, CombineModeReplace);
myGraphics.DrawLine(&myPen, 0, 0, 200, 200);
}
}
void CGDIplus2Dlg::OnSetSmoothingMode()
{
CClientDC dc(this);
Graphics myGraphics(dc.m_hDC);
Pen myPen(Color(255,255,0,0),3);
//myGraphics.SetSmoothingMode(SmoothingModeAntiAlias);
myGraphics.DrawLine(&myPen, 0, 0, 120, 80);
{
CClientDC dc(&this->m_StaticWindow);
Graphics myGraphics(dc.m_hDC);
Pen myPen(Color(255,0,255,0),3);
myGraphics.SetSmoothingMode(SmoothingModeAntiAlias);
myGraphics.DrawLine(&myPen, 0, 0, 120, 80);
}
}
CGDIplus2Dlg::OnSetSmoothingMode()
最新推荐文章于 2020-05-11 09:08:37 发布