How make wxPanel transparent on Windows and Linux?
How make wxPanel transparent on Windows and Linux?
How make wxPanel transparent on Windows and Linux?
Re: How make wxPanel transparent on Windows and Linux?
Dealing with transparency is always a difficult issue in wxWidgets. What exactly are you trying to achieve?
Use the source, Luke!
Re: How make wxPanel transparent on Windows and Linux?
i want the panel be transparent, and i tried CanGetTransparent, but unfortunately it returns false on Windows.doublemax wrote:Dealing with transparency is always a difficult issue in wxWidgets. What exactly are you trying to achieve?
Re: How make wxPanel transparent on Windows and Linux?
Semi-transparency is not possible. A completely transparent panel would be pretty much useless, it'd be just a layout element, then you could use a wxSizer instead.
You can also try wxWindow::SetBackgroundStyle( wxBG_STYLE_TRANSPARENT )
http://docs.wxwidgets.org/trunk/classwx ... f9fd6594ec
You can also try wxWindow::SetBackgroundStyle( wxBG_STYLE_TRANSPARENT )
http://docs.wxwidgets.org/trunk/classwx ... f9fd6594ec
Use the source, Luke!
Re: How make wxPanel transparent on Windows and Linux?
Thank you very much.doublemax wrote:Semi-transparency is not possible. A completely transparent panel would be pretty much useless, it'd be just a layout element, then you could use a wxSizer instead.
You can also try wxWindow::SetBackgroundStyle( wxBG_STYLE_TRANSPARENT )
http://docs.wxwidgets.org/trunk/classwx ... f9fd6594ec
But what I want is Semi-transparency...is it REALLY no way to make it Semi-transparency? THX
Re: How make wxPanel transparent on Windows and Linux?
is it possible to use a semi-transparent Bitmap as the background?
Re: How make wxPanel transparent on Windows and Linux?
What's never possible is to have a native control, e.g. a button, to be semi-transparent over a custom background.
If you draw content yourself, everything is possible, but not always easy.
It would really help if you had a screenshot or something else that shows what exactly you're trying to do.
If you draw content yourself, everything is possible, but not always easy.
It would really help if you had a screenshot or something else that shows what exactly you're trying to do.
Use the source, Luke!
Re: How make wxPanel transparent on Windows and Linux?
Thank you, and here is the link for what i want. The widget(panel here) should be semi-tranparent.doublemax wrote:What's never possible is to have a native control, e.g. a button, to be semi-transparent over a custom background.
If you draw content yourself, everything is possible, but not always easy.
It would really help if you had a screenshot or something else that shows what exactly you're trying to do.
http://forums.wxwidgets.org/viewtopic.php?f=27&t=39907
Re: How make wxPanel transparent on Windows and Linux?
Ok, now i see the "bigger picture". Together with your question about zooming, you'll definitely need a 100% custom control. The main question is whether the individual panels are wxWidgets controls, too or if everything is managed by yourself. The latter case is guaranteed to work as it gives you total freedom, but of course it's more work.
If the panels are wxWidgets controls, e.g. a wxPanel, the easiest way to get transparency would be to access the background bitmap directly. In the paint event handler you draw the correct portion of the background bitmap first, then you can draw the other content on top, if you want semi-transparent.
If the panels are wxWidgets controls, e.g. a wxPanel, the easiest way to get transparency would be to access the background bitmap directly. In the paint event handler you draw the correct portion of the background bitmap first, then you can draw the other content on top, if you want semi-transparent.
Use the source, Luke!
Re: How make wxPanel transparent on Windows and Linux?
Thank you very much! I will trydoublemax wrote:Ok, now i see the "bigger picture". Together with your question about zooming, you'll definitely need a 100% custom control. The main question is whether the individual panels are wxWidgets controls, too or if everything is managed by yourself. The latter case is guaranteed to work as it gives you total freedom, but of course it's more work.
If the panels are wxWidgets controls, e.g. a wxPanel, the easiest way to get transparency would be to access the background bitmap directly. In the paint event handler you draw the correct portion of the background bitmap first, then you can draw the other content on top, if you want semi-transparent.
Re: How make wxPanel transparent on Windows and Linux?
Help:) I didn't find how to access the bitmap, there is only a GetBackgroundBitmap for wxWindow...And I just find a way to draw bitmap by wxPaintDC.doublemax wrote:Ok, now i see the "bigger picture". Together with your question about zooming, you'll definitely need a 100% custom control. The main question is whether the individual panels are wxWidgets controls, too or if everything is managed by yourself. The latter case is guaranteed to work as it gives you total freedom, but of course it's more work.
If the panels are wxWidgets controls, e.g. a wxPanel, the easiest way to get transparency would be to access the background bitmap directly. In the paint event handler you draw the correct portion of the background bitmap first, then you can draw the other content on top, if you want semi-transparent.
Thank you .
Re: How make wxPanel transparent on Windows and Linux?
Sorry, i wasn't clear enough. There is no wxWindow method for this. This was assuming that you have a wxBitmap somewhere that you're using to draw the background. How you access that bitmap is up to you.
Use the source, Luke!
Re: How make wxPanel transparent on Windows and Linux?
I'am alittle puzzled:) I mean that there is no default API to get/set bitmap for wxPanel, but the wxWindow do have (eg. GetBackgroundBitmap).doublemax wrote:Sorry, i wasn't clear enough. There is no wxWindow method for this. This was assuming that you have a wxBitmap somewhere that you're using to draw the background. How you access that bitmap is up to you.
So ur decision is that I use wxPaintDC to draw the bitmap as the background of the wxPanel.....But I still don't how make the wxPanel's backgound semi-trasparent? Use a semi-transparent bitmap?
Re: How make wxPanel transparent on Windows and Linux?
There are methods like SetBackground(...) and GetBackgroundBitmap(...), but they're not officially documented and AFAICS they're only used in wxUniversal.
There is wxCustomBackgroundWindow though, but i remember a post from someone else saying that it doesn't work correctly with a wxScrolledWindow and i assume that's the window type that you're going to use for the background.
http://docs.wxwidgets.org/trunk/classwx ... indow.html
There is wxCustomBackgroundWindow though, but i remember a post from someone else saying that it doesn't work correctly with a wxScrolledWindow and i assume that's the window type that you're going to use for the background.
http://docs.wxwidgets.org/trunk/classwx ... indow.html
Yes. Unfortunately there is no simple call with which you can set the transparency value of the bitmap. Theoretically you could use wxGraphicsContext::BeginLayer(...) for it, but unfortunately it's not implemented under MSW.But I still don't how make the wxPanel's backgound semi-trasparent? Use a semi-transparent bitmap?
Use the source, Luke!
Re: How make wxPanel transparent on Windows and Linux?
So there is no way to get the semi-transparent on Windows? whether it is wxPanle or wxWindow?doublemax wrote:There are methods like SetBackground(...) and GetBackgroundBitmap(...), but they're not officially documented and AFAICS they're only used in wxUniversal.
There is wxCustomBackgroundWindow though, but i remember a post from someone else saying that it doesn't work correctly with a wxScrolledWindow and i assume that's the window type that you're going to use for the background.
http://docs.wxwidgets.org/trunk/classwx ... indow.html
Yes. Unfortunately there is no simple call with which you can set the transparency value of the bitmap. Theoretically you could use wxGraphicsContext::BeginLayer(...) for it, but unfortunately it's not implemented under MSW.But I still don't how make the wxPanel's backgound semi-trasparent? Use a semi-transparent bitmap?