简体   繁体   English

BitBlt 使用 C++ 反转颜色

[英]BitBlt to invert colors using C++

我正在使用 BitBlt WinAPI 使用 C++ 组合位图,我想知道我需要使用哪些标志来反转其中的颜色?

You can use BitBlt() with NOTSRCCOPY .您可以将BitBlt()NOTSRCCOPY一起NOTSRCCOPY

Here is your code:这是你的代码:

HDC hdc = GetDC(HWND_DESKTOP);
BitBlt(hdc, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), hdc, NULL, NULL, NOTSRCCOPY);

What did you try?你尝试了什么?

BitBlt : BitBlt

  • DSTINVERT Inverts the destination rectangle. DSTINVERT 反转目标矩形。
  • PATINVERT Combines the colors of the brush currently selected in hdcDest, with the colors of the destination rectangle by using the Boolean XOR operator. PATINVERT 使用布尔 XOR 运算符将当前在 hdcDest 中选择的画笔的颜色与目标矩形的颜色组合在一起。
  • SRCINVERT Combines the colors of the source and destination rectangles by using the Boolean XOR operator. SRCINVERT 使用布尔 XOR 运算符组合源矩形和目标矩形的颜色。

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

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