1

I make a function to make my GUI app transparent.Here is the code:

MyWin.wm_attributes('-transparentcolor', 'white') # make the white color transparent.

if not transparent:

enter image description here

Now it can be transparent,and likes this: enter image description here

But every words are looked strange.(it look like the config of widget relief="raised").

Is it possible to make it more normal?(it seems that those characters are surrounded by some white pixels,I try to change the font color,but it didn't solve my problem.)

jizhihaoSAMA
  • 12,336
  • 9
  • 27
  • 49

2 Answers2

2

Unfortunately I don't think you can get much further here with Tkinter.

It looks like Tkinter's implementation of window transparency is "let's call all pixels of this color transparent". Since your text (all text unless you can especially somehow manage to make it not be so) is rendered antialiased, their edges have greyscale (in fact colored, thanks to sub-pixel antialising) pixels:

Zoomed in

If you now replace all white pixels with a nice backdrop, you get the effect you're seeing:

enter image description here

AKX
  • 152,115
  • 15
  • 115
  • 172
1

Now it is okay,I change the font family.Although those characters are still surrounded by some white pixels.But now it looks better.Thanks AKX.

enter image description here

jizhihaoSAMA
  • 12,336
  • 9
  • 27
  • 49