fjosh
September 13, 2022, 4:11pm
1
Hello,
I am having trouble showing the background image on a canvas.
Here is my code:
canvas_result = st_canvas(
stroke_width=3,
background_image=Image.open(file + “.JPG”),
height=150,
drawing_mode=‘rect’,
point_display_radius=2,
key=“canvas”,
update_streamlit=True
)
Thanks for helping me debug
Hi @fjosh ,
Can you share where you’re getting stuck? Are you seeing an error?
fjosh
September 14, 2022, 7:20am
3
Hello @Caroline ,
Thank’s for the reply
Actually, I am not getting a message error. It’s just that the canvas is shown without the background image that I defined.
Here is a capture of the thanvas I am getting and a picture of my code:
@fjosh Are you seeing any error messages?
fjosh
September 15, 2022, 7:14am
5
@Caroline non no error messages, juste an empty canvas.
Have you double-checked that the image file is named “SAM_5655.JPG” (and not “SAM_5655.jpg”) and is in the same folder as the app?
fjosh
September 16, 2022, 7:17am
7
Hello @Caroline yes the image file is named “SAM_5655.JPG” and is in the same folder as the app script: