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

Add example using image icons #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Kagee
Copy link

@Kagee Kagee commented Nov 20, 2018

IT was quite a lot of work finding out how to properly convert images to the correct image format. I suggest adding this example that supports using button images from files.

@abcminiuser
Copy link
Owner

Thanks for the patch!

This is a good idea - there's code to generate custom tiles in my related HomeAssistant client project (see https://github.com/abcminiuser/python-homeassistant-streamdeck/blob/master/src/Tile/TileImage.py) although I can see it's also needed here for convenience' sake.

I've updated the example in 642bca0 to use only PIL to load custom fonts and images to generate custom tiles. I think this is about as minimal as you can get without introducing too many extra dependencies. If you think the example with svglib is warranted, let me know.

@Kagee
Copy link
Author

Kagee commented Nov 21, 2018

I would actually suggest three functions in the example, color, custom tiles, and a simple function for using different images directly. Possibly just as three functions with a simmilar signature. That should cover most use cases.

@Kagee
Copy link
Author

Kagee commented Nov 21, 2018

I feel a mixed presentation image (color, icon, icon + label) is also a good idea. Looking quickly at the image now, it may appear that the library can only create buttons with a small icon and text below. The visual presentation that a pressed button can hav another image is however also important.

@abcminiuser abcminiuser force-pushed the master branch 2 times, most recently from e2517f9 to cc07a48 Compare February 21, 2019 11:18
@ChutiReality
Copy link

Please keep on adding examples since they provided ones dont work as expected. Scaling errors for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants