选择特殊符号

选择搜索类型

热门搜索

首页 > 百科 > 建设工程百科

SetROP2

Windows API SetROP2(int nDrawMode)主要用于设定当前前景色的混合模式。R2_NOT就是取反的意思,即前景色为背景色的反色,经常用R2_NOT来画橡皮线,因为两次取反可以还原背景色。

函数原型:int SetROP2( HDC hdc, int fnDrawMode);

返回值:函数调用成功后返回调用前的模式,调用失败则返回零。

SetROP2基本信息

SetROP2​主要的作用

根据nDrawMode设置的方式重新设定绘图的方式,下面就不同的nDrawMode值具体解释绘图模式是如何改变的。

首先就nDrawMode的取值有以下的情况:

1、R2_BLACK//Pixel is always black. 所有绘制出来的像素为黑色

2、R2_WHITE//Pixel is always white. 所有绘制出来的像素为白色

3、R2_NOP//Pixel remains unchanged. 任何绘制将不改变当前的状态

4、R2_NOT//Pixel is the inverse of the screen color. 当前绘制的像素值设为屏幕像素值的反,这样可以覆盖掉上次的绘图,(自动擦除上次绘制的图形)

5、R2_COPYPEN//Pixel is the pen color. 使用当前的画笔的颜色

6、R2_NOTCOPYPEN//Pixel is the inverse of the pen color. 当前画笔的反色

//下面是当前画笔的颜色和屏幕色的组合运算得到的绘图模式。

7、R2_MERGEPENNOT//Pixel is a combination of the pen color and the inverse of the screen color (final pixel = (NOT screen pixel) OR pen). R2_COPYPEN和R2_NOT的并集

8、R2_MASKPENNOT//Pixel is a combination of the colors common to both the pen and the inverse of the screen (final pixel = (NOT screen pixel) AND pen). R2_COPYPEN和R2_NOT的交集

9、R2_MERGENOTPEN//Pixel is a combination of the screen color and the inverse of the pen color (final pixel = (NOT pen) OR screen pixel). R2_NOTCOPYPEN和屏幕像素值的并集

10、R2_MASKNOTPEN//Pixel is a combination of the colors common to both the screen and the inverse of the pen (final pixel = (NOT pen) AND screen pixel).R2_NOTCOPYPEN和屏幕像素值的交集

11、R2_MERGEPEN//Pixel is a combination of the pen color and the screen color (final pixel = pen OR screen pixel). R2_COPYPEN和屏幕像素值的并集

12、R2_NOTMERGEPEN//Pixel is the inverse of the R2_MERGEPEN color (final pixel = NOT(pen OR screen pixel)). R2_MERGEPEN的反色

13、R2_MASKPEN//Pixel is a combination of the colors common to both the pen and the screen (final pixel = pen AND screen pixel). R2_COPYPEN和屏幕像素值的交集

14、R2_NOTMASKPEN//Pixel is the inverse of the R2_MASKPEN color (final pixel = NOT(pen AND screen pixel)). R2_MASKPEN的反色

15、R2_XORPEN//Pixel is a combination of the colors that are in the pen or in the screen, but not in both (final pixel = pen XOR screen pixel). R2_COPYPEN和屏幕像素值的异或

16、R2_NOTXORPEN//Pixel is the inverse of the R2_XORPEN color (final pixel = NOT(pen XOR screen pixel)). R2_XORPEN的反色

总之,上述api的一个作用是在需要改变绘图的模式时,不需要重新设置画笔,只需要设置不同的绘图的模式即可达到相应的目的。

查看详情

SetROP2造价信息

  • 市场价
  • 信息价
  • 询价

2-2APxfj2

  • 详见图纸
  • 1台
  • 1
  • 中高档
  • 含税费 | 含运费
  • 2022-11-03
查看价格

2-2AA2

  • 详见系统图
  • 1台
  • 3
  • 详见附件
  • 中档
  • 含税费 | 含运费
  • 2022-07-20
查看价格

2-2AY2

  • 详见系统图
  • 1台
  • 3
  • 详见附件
  • 中档
  • 含税费 | 含运费
  • 2022-07-20
查看价格

2-2AL2

  • 600×800×250
  • 1台
  • 3
  • 中高档
  • 含税费 | 含运费
  • 2020-07-22
查看价格

2-2AL2

  • 56kW
  • 1个
  • 1
  • 中档
  • 不含税费 | 不含运费
  • 2019-07-03
查看价格

SetROP2使用实例

void CXXXView::OnMouseMove(UINT nFlags, CPoint point)

{

// 按下左键移动开始画图

if (nFlags == MK_LBUTTON)

{

// 创建画笔RGB(0x00, 0x00, 0xFF)

HPEN hPen = ::CreatePen(PS_SOLID, m_PenWidth, RGB(0x00, 0x00, 0xFF));

// 使用画笔

::SelectObject(m_hMemDC, hPen);

//设置系统色彩模式取反色

int oldRop=::SetROP2(m_hMemDC,R2_NOTXORPEN);

// 画线

::MoveToEx(m_hMemDC,m_pOrigin.x,m_pOrigin.y, NULL);

::LineTo(m_hMemDC, m_pPrev.x,m_pPrev.y);

//恢复系统默认色彩模式

::SetROP2(m_hMemDC,oldRop);

::MoveToEx(m_hMemDC, m_pOrigin.x, m_pOrigin.y, NULL);

::LineTo(m_hMemDC, point.x, point.y);

m_pPrev = point;

Invalidate(FALSE);

}

}

查看详情

SetROP2概述

用于设定当前前景色的混合模式。R2_NOT就是取反的意思,即前景色为背景色的反色,经常用R2_NOT来画橡皮线,因为两次取反可以还原背景色。

查看详情

SetROP2常见问题

查看详情

SetROP2文献

Groundwater Hydrology#2: Aquifers, Porosity, Groundwater Hydrology#2: Aquifers, Porosity,

Groundwater Hydrology#2: Aquifers, Porosity,

格式:pdf

大小:207KB

页数: 10页

Groundwater Hydrology#2: Aquifers, Porosity,——Unsaturated Zone, Vadose Zone, Soil Moisture Zone, Zone of Aeration – rock, water and air   Capillary Fringe – region above water table where water rises due to capillary for...

OMRON阀位开关(WLCA2-2) OMRON阀位开关(WLCA2-2)

OMRON阀位开关(WLCA2-2)

格式:pdf

大小:207KB

页数: 5页

OMRON阀位开关(WLCA2-2)

相关推荐

立即注册
免费服务热线: 400-888-9639