![](/img/trans.png)
[英]C++ WinAPI Conflict between SetLayeredWindowAttributes and BitBlt
[英]Failing to bitblt() to the centre of a transparent window c++/winapi
当我将bbit移到比客户区域小的bmp透明窗口上时,它将绘制一个繁琐的周围区域,而不是像下面的set colorkey那样透明:
SetLayeredWindowAttributes(hwnd, RGB(0,255,0), 120, LWA_COLORKEY | LWA_ALPHA); //colorkey & win alpha
blit看起来像这样:
像蜡烛一样的测试图像使它自己的区域像应该的那样透明,但是周围的客户区域会根据窗口alpha值变灰(120)。 任何想法如何解决这一问题? 我试过了:
SetBkColor(hdc, crKey); and generating a background with
FillRect(background_hdc, &background_rect, hbrush); and blitting that first
哪里都不行。
我觉得这应该比我想象的要容易得多,而且我仍然感觉像SetBkColor(hdc,crKey);
应该可以解决问题,但事实并非如此。 也许我正在寻找类似的命令?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.