请问各位大神用png做透明按钮一般是怎么处理的啊 Topic is solved

这是wxWidgets论坛的中文版本。在这里,您可以用您的母语汉语讨论上面任一子论坛所涉及的所有关于wxWidgets的话题。欢迎大家参与到对有价值的帖子的中英互译工作中来!
Post Reply
iwobz
In need of some credit
In need of some credit
Posts: 5
Joined: Mon Jun 04, 2012 9:59 am

请问各位大神用png做透明按钮一般是怎么处理的啊

Post by iwobz » Sun Jun 17, 2012 1:03 pm

请问在wxWidgets里面用png怎么做透明按钮啊
我看了一下MFC里面的实现方式,一般都是先设置按钮的BS_OWNERDRAW样式,
然后在WM_CTLCOLORBTN里面返回return (LRESULT)GetStockObject(NULL_BRUSH);
这样按钮的背景直接就是父窗口的背景,直接画图片或者显示文字就可以了,
可是我在wxWidgets里面就算改了WM_CTLCOLORBTN的响应方式还是不行,按钮(wxBitmapButton)背景始终是白色的,我切底无语了,请大神们支支招吧

iwobz
In need of some credit
In need of some credit
Posts: 5
Joined: Mon Jun 04, 2012 9:59 am

Re: 请问各位大神用png做透明按钮一般是怎么处理的啊

Post by iwobz » Thu Aug 16, 2012 3:55 am

想了个笨办法,自己搞定了

pyliang_2008
In need of some credit
In need of some credit
Posts: 1
Joined: Thu Aug 23, 2012 2:40 am

Re: 请问各位大神用png做透明按钮一般是怎么处理的啊

Post by pyliang_2008 » Thu Aug 23, 2012 2:44 am

你好,我现在也想用wxWidget做PNG的透明按钮,但是实验了很多方法,都不行,要么就直接透视到电脑的桌面了,要么就是透视不了,请问一下你是怎么处理的呀?

kipade
Earned some good credits
Earned some good credits
Posts: 118
Joined: Fri Nov 11, 2011 2:45 am
Location: China

Re: 请问各位大神用png做透明按钮一般是怎么处理的啊

Post by kipade » Fri Aug 24, 2012 8:05 am

参考一下wxSkin里面的做法
Slackware GNU/Linux
wxWidgets-3.0.3

Post Reply