简体   繁体   English

wxBitmap透明背景

[英]wxBitmap transparent background

I have a wxBitmap which can be hidden or revealed on a wxPanel. 我有一个wxBitmap,可以将其隐藏或显示在wxPanel上。 When the wxBitmap is hidden I would like it to have the background of the wxPanel, instead it has a standard grey background. 隐藏wxBitmap时,我希望它具有wxPanel的背景,而不是标准的灰色背景。

To illustrate my point here are two images: 为了说明我的观点,这里有两个图像:

Bitmap shown: http://i.stack.imgur.com/PzpR9.png 显示的位图: http : //i.stack.imgur.com/PzpR9.png

Bitmap hidden: http://i.stack.imgur.com/GWs7r.png 隐藏的位图: http : //i.stack.imgur.com/GWs7r.png

I tried applying a mask and using alpha channel for transparency, but these do not solve the problem. 我尝试应用蒙版并使用Alpha通道实现透明,但是这些不能解决问题。 What I need to do is set the background of the wxBitmap. 我需要做的是设置wxBitmap的背景。

Any ideas how I can accomplish this? 有什么想法我可以做到这一点吗?

I have noticed that if I minimise the window and then show it again, the problem is solved - no default grey background when the bitmap is hidden. 我注意到,如果我最小化窗口,然后再次显示它,问题就解决了-隐藏位图时没有默认的灰色背景。 I do not know what operation this (minimise + maximise) procedure performs and I have not yet figured out how to implement it programmatically. 我不知道此(最小化+最大化)过程执行什么操作,并且我还没有弄清楚如何以编程方式实现它。

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

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