Browse Source

Merge pull request #1036 from zauberzeug/base64_image_demo

provide ui.image demo for base64 data
Falko Schindler 1 year ago
parent
commit
d1ec0ceea8
1 changed files with 7 additions and 0 deletions
  1. 7 0
      website/more_documentation/image_documentation.py

+ 7 - 0
website/more_documentation/image_documentation.py

@@ -16,6 +16,13 @@ def more() -> None:
     def local():
         ui.image('website/static/logo.png').classes('w-16')
 
+    @text_demo('Base64 string', '''
+        You can also use a Base64 string as image source.
+    ''')
+    def base64():
+        base64 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='
+        ui.image(base64).classes('w-2 h-2 m-auto')
+
     @text_demo('Lottie files', '''
         You can also use [Lottie files](https://lottiefiles.com/) with animations.
     ''')