it is no difficult. you can use CDC::SetROP2 to set drawing mode is R2_NOT mode.R2_NOT: Pixel is the inverse of the screen color.then, you are drawed rectangle by LineTo to drawing four lines.of course. you can dirctness to use CDC::Rectangle, but it is not very good.
你用 R2_NOT 方法画线,其实不用重绘的,当然我也不知道你的频谱图是不是老是变化的,如果是老是变化也许不好,如果是不变的,你就用R2_NOT or R2_XOR画,最后你在你以为要重绘的代码处,再画一次线,这样开始的频谱图不是还是恢复过来了吗。也就是说画两次(也是偶数次),就等于没有画。note: not ( not a) == a (screen xor line) xor line == screen.上面的等式是成立的,我相信你也知道。
not ( not a) == a
(screen xor line) xor line == screen.上面的等式是成立的,我相信你也知道。
例如透明度为alpha(0~1)color source;//源
color pen; //画笔
color dest; // 结果dest.red = source.red*(1-alpha)+pen.red*alpha;
dest.blue...(同上)
dest.green..