How can I make a TextCtrl have a transparent background? By this I mean see the desktop behind it.
Current Code:
self.control.SetBackgroundColour(wx.Color(0,0,0,0))
But that just makes the background colour black.
I am using Python 2.7 on Windows 7
To my knowledge textCtrt can't be transparent or use a background image, but you can change the background color.
TIP:
You can use the exact color as your background image by finding out the exact HEX color value.
Example code:
self.SetBackgroundColour('#232321')
Related
My problem seems a bit special and none of my friends have an answer for me.
Indeed, I have animations made on after effect with a transparent background that I recorded in .mov and I tried to put it on python.
However, the transparent background automatically becomes black when i launch my program even if the background is transparent in the video. Also, I can't use the set_colorkey command because my animations have lights that change the outline color (so I can't figure out which colors to remove).
Would you have any solutions for me to directly import my video with its transparent background please?
Thanks in advance !
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.
Here is my code.
png image without background
Here is a result. Is it even possible to remove image background in tkinter or I have to make same color as on image?
Looks like you have the basic grey background to you're added picture by tkinter.
So try if it is possible to change you're backround from grey to for example red with:
tag: bg="red", if that is possible, you can just change the color to the blue background.
Label(root,image=self.img, bg="blue")
I tested it and it worked out for me.
Its not possible as far as i know to use rgb() or the hexadezimal with the transperancy option.
Gave me back errors.
Its not really transperent but kind of a solution !
Good Luck !
I was wondering if it was possible to set the background colour of text, using ANSI colour codes, to transparent, or just the colour of the terminal, so you can use colours without having to deal with the background colour not being the right colour.
You can do this by ending the escape code using 49m. For example, red text on a transparent background would be \033[1;31;49m.
Happy colouring!
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?