码迷,mamicode.com
首页 > 其他好文 > 详细

SetROP2

时间:2014-09-19 23:49:56      阅读:335      评论:0      收藏:0      [点我收藏+]

标签:color   io   使用   ar   on   c   r   as   不同的   

int SetROP2(
HDC hdc, // handle to DC
int fnDrawMode // drawing mode
);  
  该函数的主要的作用是根据nDrawMode设置的方式重新设定绘图的方式,
下面就不同的nDrawMode值具体解释绘图模式是如何改变的。
  首先就nDrawMode的取值有以下的情况:
  R2_BLACK Pixel is always black. //所有绘制出来的像素为黑色
  R2_WHITE Pixel is always white. //所有绘制出来的像素为白色
  R2_NOP Pixel remains unchanged. //任何绘制将不改变当前的状态
  R2_NOT Pixel is the inverse of the screen color. //当前绘制的像素值设为屏幕像素值的反,
这样可以覆盖掉上次的绘图,(自动擦除上次绘制的图形)
  R2_COPYPEN Pixel is the pen color. //使用当前的画笔的颜色
  R2_NOTCOPYPEN Pixel is the inverse of the pen color. //当前画笔的反色

  //下面是当前画笔的颜色和屏幕色的组合运算得到的绘图模式。
  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_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_MERGENOTPEN Pixel is a combination of the screen color and the inverse of the pen color
(final pixel = (NOT pen) OR screen pixel).

  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_MERGEPEN Pixel is a combination of the pen color and the screen color
(final pixel = pen OR screen pixel).

  R2_NOTMERGEPEN Pixel is the inverse of the R2_MERGEPEN color
(final pixel = NOT(pen OR screen pixel)).

  R2_MASKPEN Pixel is a combination of the colors common to both the pen and the screen
(final pixel = pen AND screen pixel).

  R2_NOTMASKPEN Pixel is the inverse of the R2_MASKPEN color (final pixel = NOT(pen AND screen pixel)).
  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_NOTXORPEN Pixel is the inverse of the R2_XORPEN color
(final pixel = NOT(pen XOR screen pixel)).

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

SetROP2

标签:color   io   使用   ar   on   c   r   as   不同的   

原文地址:http://www.cnblogs.com/spiritofcloud/p/3982616.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!