rm-hull / luma.examples

Companion repo for running examples against the luma.oled, luma.lcd, luma.led_matrix and luma.emulator display drivers.
MIT License
380 stars 147 forks source link

Display image within canvas #87

Open ayhlai opened 6 years ago

ayhlai commented 6 years ago

From the examples I have seen and tried , so display a picture such as png, I need to use the device.display method. Is it possible to display an image within a canvas.

What I would like to do is to display an image inside with canvas(device, dither=True) as draw: so that I can have a mixture of text and png in one screen, similar to colors.py example but displaying the canvas and image at the same time.

Is it possible?

Thanks for this great library.

dummys commented 6 years ago

same question here

thijstriemstra commented 6 years ago

ping @rm-hull

iv-med commented 5 years ago

I have the same question!

rm-hull commented 5 years ago

Have a look at https://luma-core.readthedocs.io/en/latest/render.html#luma.core.render.canvas - you'll notice that it takes an optional background image as one of its arguments. Construct a pillow image from a PNG, pass that in as a background, and then draw on it.

iv-med commented 5 years ago

Have a look at https://luma-core.readthedocs.io/en/latest/render.html#luma.core.render.canvas - you'll notice that it takes an optional background image as one of its arguments. Construct a pillow image from a PNG, pass that in as a background, and then draw on it.

Ok, but if I want to place some images on the canvas? I have to merge images?

rm-hull commented 4 years ago

@iv-med if you want to just display images, there is no need to use the canvas, just call device.display(image) .. the canvas is only there for drawing on.