Another question to wxpython.
I have a Frame with (at the moment) 3 Panels. All of them contain *.png pictures with transparent parts.
But behind these transparent parts there is the grey from the Frame background.
What I want is just a transparent background, that I can see for example my Desktop or whatever is behind the programm in that moment.
All I found was SetTransparent(0) but this made the full programm transparent and the other thing was to change the shape, but that dosen't made anything, except change width/heigth, if the shape has not the same properties.
Related
I have a label that is the background image and a frame on that label that shows other images and buttons, but I have some white spaces. Is it possible to make those spaces transparent to show the background image?
I've tried making the background a color and making that color transparent with:
window.attributes("-transparentcolor", "#20fc03");
frame.configure(background="20fc03");
but it makes the whole window transparent showing my desktop.
I can provide code if needed, I just do not know what would be useful.
I'm trying to make a GUI in tkinter that uses one image as an overlay on top of another, but when I place the image over the lower one, the transparent area of the image appears as grey.
I've searched for solutions to this, but all the results that I've found have pointed towards using PIL.
Is it possible for me to use transparent, or partially transparent images in the python tkinter module without using PIL?
You could use some basic photoshop tools like the magic wand tool to remove the background, but keep in mind, some PNG format images have a faint background. This is either in the from of a watermark, or the image background was rendered with a lower opacity than the rest of the image. Your GUI may also have a layer placed above the images by default. Does it appear on each image seperatly when loaded into the GUI?
I'm a beginner of PyQt, and I'm reading some examples in tutorials.
When I build an image viewer from example, I find the result is weird.
https://github.com/Werkov/PyQt4/blob/master/examples/widgets/imageviewer.py
Why there is a blank area on the top left of main window? How can I remove it?
The white rectangle is the self.imageLabel object. It is white because of the self.imageLabel.setBackgroundRole(QtGui.QPalette.Base) in the main window constructor. Just comment it out and the rectangle will disappear.
The side effect of this will be that if you open a transparent image, its background will be dark gray (as the background of the rest of the window inside) and not white. If you want it white, move the line self.imageLabel.setBackgroundRole(QtGui.QPalette.Base) to the end of the open method and indent it four spaces.
I have followed the tutorial here: Transparent Frames
How can I make it so only the text from TextCtrl has 100% opacity while the rest of the window is invisible? What i mean is, I want an invisible window except for the text in TextCtrl.
I am on Windows 7, using python 2.7.
According to the tutorial you linked:
Only top-level controls can be transparent; no other controls can
A textctrl or statictxt, of course, is not a top level control.
There is this option, which I believe only works ontop of other opaque objects not on a transparent panel.
This shows how to draw an arbitrarily shaped window. If you combine (somehow) the above two, you should be able to get text against a transparent background. Other than that, good luck.
While using wxPython in creating GUI for Windows, I am encountering a problem where the wx.Panel's background colour and parent frame's background colours are not matching (one is light gray while the other one is of darker hue). However, this is not evident in Linux with the same code.
How can I match the two different background colours in Windows?
The embedded screenshot may give a fair idea of what I am talking about.
!Screenshot of the GUI1
Create a container panel that has the wx.Frame as parent (hence you get the light gray background color for the frame).
Use this panel as parent for all widgets contained in the frame.
Edit: the only reason is that default background color for frames is dark grey on Windows, see WxFAQ.