add color_image.py test for ColorBitMap widget

pull/49/head
troyhy 2024-09-03 20:26:40 +03:00
rodzic 3d6b485f3d
commit 44987d0c5e
3 zmienionych plików z 2200 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,44 @@
# color_image.py Minimal micro-gui demo.
# Released under the MIT License (MIT). See LICENSE.
import hardware_setup # Create a display instance
from gui.core.ugui import Screen, ssd
from gui.widgets import Label, Button, CloseButton
from gui.widgets.color_bitmap import ColorBitMap
from gui.core.writer import CWriter
# Font for CWriter
import gui.fonts.arial10 as arial10
from gui.core.colors import *
import test_bitmap
class BaseScreen(Screen):
def __init__(self):
super().__init__()
# verbose default indicates if fast rendering is enabled
wri = CWriter(ssd, arial10, GREEN, BLACK)
image = ColorBitMap(
wri,
20,
0,
96,
318,
)
image.value(test_bitmap)
CloseButton(wri) # Quit the application
def test():
print("Color image demo for 170x320px display")
Screen.change(BaseScreen) # A class is passed here, not an instance.
test()

Plik diff jest za duży Load Diff

BIN
images/test.png 100644

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 12 KiB