luma.examples icon indicating copy to clipboard operation
luma.examples copied to clipboard

Display image within canvas

Open ayhlai opened this issue 6 years ago • 6 comments

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.

ayhlai avatar May 22 '18 17:05 ayhlai

same question here

dummys avatar Jul 04 '18 08:07 dummys

ping @rm-hull

thijstriemstra avatar Jul 04 '18 12:07 thijstriemstra

I have the same question!

iv-med avatar Jan 05 '19 20:01 iv-med

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.

rm-hull avatar Jan 05 '19 21:01 rm-hull

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?

iv-med avatar Jan 05 '19 21:01 iv-med

@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.

rm-hull avatar Oct 30 '20 23:10 rm-hull