实时绘制曲线-SetROP2方法

//绘制光圈
CDC* dc = GetDC();
int oldrop = dc->GetROP2();
dc->SetROP2(R2_XORPEN);

HPEN hpen = CreatePen(PS_SOLID,2,RGB(0,255,0));
dc->SelectObject(hpen);
dc->SelectObject(GetStockObject(NULL_BRUSH));

dc->Ellipse((OriginPos.x-Diameter/2.0),(OriginPos.y-Diameter/2.0),(OriginPos.x+Diameter/2.0),(OriginPos.y+Diameter/2.0));
dc->Ellipse((point.x-Diameter/2.0),(point.y-Diameter/2.0),(point.x+Diameter/2.0),(point.y+Diameter/2.0));

OriginPos = point;

dc->SetROP2(oldrop);

::DeleteObject(hpen);
::DeleteObject(GetStockObject(NULL_BRUSH));
ReleaseDC(dc);

你可能感兴趣的:(实时绘制曲线-SetROP2方法)