Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make components compatible with background images. #12

Closed
vednig opened this issue Nov 4, 2021 · 3 comments
Closed

Make components compatible with background images. #12

vednig opened this issue Nov 4, 2021 · 3 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@vednig
Copy link

vednig commented Nov 4, 2021

Enhancement:

  • Make components compatible with background images.

Currently:

image

@TomSchimansky TomSchimansky added the enhancement New feature or request label Nov 4, 2021
@TomSchimansky
Copy link
Owner

TomSchimansky commented Nov 4, 2021

That would be great but sadly that's not possible with Tkinter, or to be more precise, its not possible in the way how I draw the buttons. Because I draw the buttons on a Canvas which is rectangular and I simply set the bg color of the canvas to the color that's behind it. Because in Tkinter its not possible to make the background of the Canvas transparent as far as I now.
So a possibility would be that you pass the bg image to the button and I crop the exact part out of the image that the button covers and place it on the canvas of the button, but that would be difficult to get exactly right and you wouldn't be able to move the button.
So as a workaround I would just do something like this:

code: examples/example_background_image.py

Bildschirmfoto 2021-11-04 um 13 00 19

@TomSchimansky TomSchimansky added the documentation Improvements or additions to documentation label Nov 4, 2021
@vednig
Copy link
Author

vednig commented Nov 5, 2021

I'll try implementing soon.
( Only for Static Images ) via bbox of component along with adding configure attribute to other components.

@Akascape
Copy link

@vednig A new solution for this issue: #2214

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants