本文整理汇总了C++中CClientDC::SetROP2方法的典型用法代码示例。如果您正苦于以下问题:C++ CClientDC::SetROP2方法的具体用法?C++ CClientDC::SetROP2怎么用?C++ CClientDC::SetROP2使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CClientDC
的用法示例。
在下文中一共展示了CClientDC::SetROP2方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MoveElement
void CSketcherView::MoveElement(CClientDC & aDC, const CPoint & point)
{
CSize distance = point - m_CursorPos; // Get move distance
m_CursorPos = point; // Set current point as 1st for next time
// If there is an element selected, move it
if(m_pSelected)
{
if (typeid(*m_pSelected) == typeid(CText))
{
CRect oldRect=m_pSelected->GetBoundRect(); // Get old bound rect
aDC.LPtoDP(oldRect); // Convert to client coords
m_pSelected->Move(distance); // Move the element
InvalidateRect(&oldRect); // Invalidate combined area
UpdateWindow(); // Redraw immediately
m_pSelected->Draw(&aDC,m_pSelected); // Draw highlighted
return;
}
// ...otherwise, use this method
aDC.SetROP2(R2_NOTXORPEN);
m_pSelected-> Draw(&aDC, m_pSelected); // Draw the element to erase it
m_pSelected-> Move(distance); // Now move the element
m_pSelected-> Draw(&aDC, m_pSelected); // Draw the moved element
}
}
示例2: MoveElement
void CSketcherView::MoveElement(CClientDC & aDC, const CPoint & point)
{
CSize distance = point - m_CursorPos; // Get move distance
m_CursorPos = point; // Set current point as 1st for
// next time
// If there is an element selected, move it
if(m_pSelected)
{
aDC.SetROP2(R2_NOTXORPEN);
m_pSelected-> Draw(&aDC, m_pSelected); // Draw the element to erase it
m_pSelected-> Move(distance); // Now move the element
m_pSelected-> Draw(&aDC, m_pSelected); // Draw the moved element
}
}