added init image

This commit is contained in:
Brian Bjarke Jensen
2024-02-24 00:03:39 +01:00
parent 51c96b36cb
commit 20de0376b6
2 changed files with 13 additions and 11 deletions
+12 -10
View File
@@ -1,17 +1,19 @@
import dash_mantine_components as dmc
from dash import html
from pathlib import Path
from base64 import b64encode
# read init img
init_img_path = Path(__file__).parent / "init_img.png"
with open(init_img_path.absolute(), "rb") as fh:
init_img_enc = b64encode(fh.read()).decode("utf-8")
image_element = dmc.Center(
dmc.Image(
html.Img(
style={
"width": "100%",
},
id="image-container",
width=600,
height=600,
withPlaceholder=True,
placeholder=[
dmc.Loader(
color="gray",
size="md"
)
]
src=f"data:image/png;base64, {init_img_enc}"
)
)
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB