简体   繁体   English

C#中两个GraphicsBuffer的XOR

[英]XOR of Two GraphicsBuffer in c#

I have two GraphicsBuffer in c#, I want to take XOR of both the buffers and stored in third variable. 我在c#中有两个GraphicsBuffer,我想对两个缓冲区进行XOR运算并存储在第三个变量中。 Kindly guide me so that I can make it possible. 请指导我,使我能够实现这一目标。

  1. Extract each data item/byte from each of the two buffers. 从两个缓冲区中的每一个提取每个数据项/字节。
  2. Combine the two such bytes using the XOR operator - byte3 = byte1 ^ byte2 使用XOR运算符将两个这样的字节合并-byte3 = byte1 ^ byte2
  3. Add the resulting byte3 to the last GraphicsBuffer. 将结果字节3添加到最后的GraphicsBuffer。
  4. Repeat until you have gone through all the data/bytes. 重复进行,直到遍历所有数据/字节。

I've never Xor'ed a Graphics buffer, but I've Xor encrypted a few things and I imagine it's much the same thing. 我从来没有对图形缓冲区进行“异或”处理,但是我对“异或”进行了一些加密,并且我想它几乎是同一回事。 You can read it here: http://freedom2blog.com/2010/05/easy-encryption-using-bitwise-exclusive-or-xor/ 您可以在这里阅读: http : //freedom2blog.com/2010/05/easy-encryption-using-bitwise-exclusive-or-xor/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM