VC高手请进!
CPennewPen(m_nLineStyle,1,RGB(255,0,0));CPen*pOldPen=dc.SelectObject(&newPen);dc.SetR...
CPen newPen(m_nLineStyle,1,RGB(255,0,0));
CPen* pOldPen = dc.SelectObject(&newPen);
dc.SetROP2(R2_NOTXORPEN);
dc.MoveTo(m_pntOrigin);
dc.LineTo(m_pntPrev);
dc.MoveTo(m_pntOrigin);
dc.LineTo(point);
m_pntPrev=point;
dc.SelectObject(pOldPen);
上面代码中R2_NOTXORPEN到底是什么意思?R2_NOTXORPEN与R2_NOT有什么区别?回答越准确详细就给高分!请勿百度,几乎没答案!
请一楼的回答详细点。。。。最详细的我给分!
实话告诉大家,起步分是100! 展开
CPen* pOldPen = dc.SelectObject(&newPen);
dc.SetROP2(R2_NOTXORPEN);
dc.MoveTo(m_pntOrigin);
dc.LineTo(m_pntPrev);
dc.MoveTo(m_pntOrigin);
dc.LineTo(point);
m_pntPrev=point;
dc.SelectObject(pOldPen);
上面代码中R2_NOTXORPEN到底是什么意思?R2_NOTXORPEN与R2_NOT有什么区别?回答越准确详细就给高分!请勿百度,几乎没答案!
请一楼的回答详细点。。。。最详细的我给分!
实话告诉大家,起步分是100! 展开
展开全部
SetROP2就是设置绘画的模式,绘画模式有很多种,比如最简单的绘画模式就是你的当前画笔是什么颜色,在屏幕上画的就是什么颜色,R2_NOTXORPEN这种绘画模式是这样的,它先把画笔颜色与屏幕颜色异或,(这里异或是数学计算,1与1为0,1与0为1,我们说颜色其实就是二进制数,)异或之后再取反最后得到一个颜色值显示在屏幕上。
举个例子,你使用R2_NOTXORPEN这种绘画模式,你用红色画笔在黑色背景上画一条直线,显示红色,但你再用这只笔在刚画的直线上重画一遍,就相当于把开始画的红线擦除掉了,划线的地方显示为背景色。
R2_NOT绘画模式同样有在同一个地方画两次相当于什么都没画的功能,不过R2_NOT绘画模式第一次画的时候显示颜色并不是你选定的画笔颜色,而是默认的颜色。
这就是这两种绘画模式的区别
举个例子,你使用R2_NOTXORPEN这种绘画模式,你用红色画笔在黑色背景上画一条直线,显示红色,但你再用这只笔在刚画的直线上重画一遍,就相当于把开始画的红线擦除掉了,划线的地方显示为背景色。
R2_NOT绘画模式同样有在同一个地方画两次相当于什么都没画的功能,不过R2_NOT绘画模式第一次画的时候显示颜色并不是你选定的画笔颜色,而是默认的颜色。
这就是这两种绘画模式的区别
展开全部
难道你连MSDN都没装吗?
CDC::SetROP2
int SetROP2( int nDrawMode );
设置当前的绘画模式。
返回前一个绘画模式。可以是 windows sdk 文档中给出的任何值。
参数:nDrawMode
指定一个新的绘画模式,可以是下面的任何值:
太多了,我就不一一翻译了,下面是MSDN中的原文。
CDC::SetROP2
int SetROP2( int nDrawMode );
Return Value
The previous drawing mode.
It can be any of the values given in the Windows SDK documentation.
Parameters
nDrawMode
Specifies the new drawing mode. It can be any of the following values:
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)).
像素是 R2_XORPEN 取反。就是说刚好和 R2_XORPEN 相反。
Remarks
Sets the current drawing mode. The drawing mode specifies how the colors of the pen and the interior of filled objects are combined with the color already on the display surface.
The drawing mode is for raster devices only; it does not apply to vector devices. Drawing modes are binary raster-operation codes representing all possible Boolean combinations of two variables, using the binary operators AND, OR, and XOR (exclusive OR), and the unary operation NOT.
CDC::SetROP2
int SetROP2( int nDrawMode );
设置当前的绘画模式。
返回前一个绘画模式。可以是 windows sdk 文档中给出的任何值。
参数:nDrawMode
指定一个新的绘画模式,可以是下面的任何值:
太多了,我就不一一翻译了,下面是MSDN中的原文。
CDC::SetROP2
int SetROP2( int nDrawMode );
Return Value
The previous drawing mode.
It can be any of the values given in the Windows SDK documentation.
Parameters
nDrawMode
Specifies the new drawing mode. It can be any of the following values:
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)).
像素是 R2_XORPEN 取反。就是说刚好和 R2_XORPEN 相反。
Remarks
Sets the current drawing mode. The drawing mode specifies how the colors of the pen and the interior of filled objects are combined with the color already on the display surface.
The drawing mode is for raster devices only; it does not apply to vector devices. Drawing modes are binary raster-operation codes representing all possible Boolean combinations of two variables, using the binary operators AND, OR, and XOR (exclusive OR), and the unary operation NOT.
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
R2_NOTXORPEN Pixel is the inverse of the R2_XORPEN color (final pixel = NOT(pen XOR screen pixel)).
这个作用是你设定画笔的颜色与屏幕颜色异或或再取反的颜色,作为你画线的颜色!
R2_NOT Pixel is the inverse of the screen color.
这个作用是采用与屏幕颜色取反的颜色画线
这个作用是你设定画笔的颜色与屏幕颜色异或或再取反的颜色,作为你画线的颜色!
R2_NOT Pixel is the inverse of the screen color.
这个作用是采用与屏幕颜色取反的颜色画线
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
想学VC吗? 装了VC好歹装上MSDN.
R2_NOT Pixel is the inverse of the screen color.
象素的颜色为 屏幕当前位置的颜色取反;
R2_NOTXORPEN Pixel is the inverse of the R2_XORPEN color (final pixel = NOT(pen XOR screen pixel)).
首先把画笔的颜色与屏幕当前位置的颜色做XOR(异或), 然后取反;
R2_NOT Pixel is the inverse of the screen color.
象素的颜色为 屏幕当前位置的颜色取反;
R2_NOTXORPEN Pixel is the inverse of the R2_XORPEN color (final pixel = NOT(pen XOR screen pixel)).
首先把画笔的颜色与屏幕当前位置的颜色做XOR(异或), 然后取反;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
R2_NOTXORPEN异或画笔的功能
r2_not:设备场景的新绘图模式
r2_not:设备场景的新绘图模式
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询