Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from streamlit_drawable_canvas import st_canvas
|
3 |
+
|
4 |
+
st.title("Canvas Drawing App")
|
5 |
+
|
6 |
+
canvas_result = st_canvas(
|
7 |
+
fill_color="rgba(255, 165, 0, 0.3)", # Filled color
|
8 |
+
stroke_width=3, # Stroke width
|
9 |
+
stroke_color="#000000", # Stroke color
|
10 |
+
background_color="#ffffff", # Canvas background color
|
11 |
+
update_streamlit=True,
|
12 |
+
height=500,
|
13 |
+
width=500,
|
14 |
+
drawing_mode="freedraw",
|
15 |
+
key="canvas",
|
16 |
+
)
|
17 |
+
|
18 |
+
if canvas_result.image_data is not None:
|
19 |
+
st.image(canvas_result.image_data)
|