How to use the guizero.Picture function in guizero

To help you get started, we’ve selected a few guizero examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lawsie / guizero / tests / test_picture.py View on Github external
    inherited_properties_test(a, lambda: Picture(a), False)
    a.destroy()
github lawsie / guizero / tests / test_picture.py View on Github external
def test_grid_layout():
    a = App(layout="grid")
    
    w = Picture(a, grid=[1,2])
    grid_layout_test(w, 1, 2, 1, 1, None)
    
    ws = Picture(a, grid=[1,2,3,4])
    grid_layout_test(ws, 1, 2, 3, 4, None)

    wa = Picture(a, grid=[1,2], align="top")
    grid_layout_test(wa, 1, 2, 1, 1, "top")
    
    a.destroy()
github lawsie / guizero / tests / test_picture.py View on Github external
def test_color():
    a = App()
    p = Picture(a)
    color_test(p)
    a.destroy()
github lawsie / guizero / tests / test_picture.py View on Github external
def test_after_schedule():
    a = App()
    p = Picture(a)
    schedule_after_test(a, p)
    a.destroy()
github lawsie / guizero / tests / test_picture.py View on Github external
def test_grid_layout():
    a = App(layout="grid")
    
    w = Picture(a, grid=[1,2])
    grid_layout_test(w, 1, 2, 1, 1, None)
    
    ws = Picture(a, grid=[1,2,3,4])
    grid_layout_test(ws, 1, 2, 3, 4, None)

    wa = Picture(a, grid=[1,2], align="top")
    grid_layout_test(wa, 1, 2, 1, 1, "top")
    
    a.destroy()
github lawsie / guizero / tests / test_picture.py View on Github external
def test_enable():
    a = App()
    p = Picture(a)
    enable_test(p)
    a.destroy()
github lawsie / guizero / examples / load_picture.py View on Github external
from guizero import App, Picture
app = App()
picture = Picture(app, image="guizero.gif")
picture_png = Picture(app, image="guizero.png")
app.display()
github martinohanlon / quickdraw_python / examples / guizero_display.py View on Github external
#  windows - pip install guizero
#  macos - pip3 install guizero
#  linux/raspberry pi - sudo pip3 install guizero

from guizero import App, Text, Combo, Picture
from quickdraw import QuickDrawData

def display_drawing():
    display.image = qd.get_drawing(drawing_name.value).image

qd = QuickDrawData()

app = App(title="Quick, Draw! Viewer")
Text(app, text="Pick a drawing")
drawing_name = Combo(app, options=qd.drawing_names, selected=qd.drawing_names[0], command=display_drawing)
display = Picture(app)
status = Text(app)
display_drawing()
display.repeat(1000, display_drawing)
app.display()
github ikanel / PiHub / PythonPi / informer.py View on Github external
baseheight = 768
    global picture
    if picture is not None:
        master = picture.master
        picture.destroy()
        master.focus()

    pilImage = rotateByExif(Image.open(imageUrl))
    if (pilImage.size[1] > pilImage.size[0]):
        basewidth = int(float(baseheight) / float(pilImage.size[1]) * float(pilImage.size[0]))

    wpercent = (basewidth / float(pilImage.size[0]))
    hsize = int((float(pilImage.size[1]) * float(wpercent)))
    rpil = pilImage.resize((basewidth, hsize), Image.ANTIALIAS)

    picture = Picture(master, image=rpil)
    return picture
github lawsie / guizero / examples / scale_picture.py View on Github external
from guizero import App, Slider, Picture

def resize():
    picture.resize(width.value, height.value)

app = App(layout="grid", width=550, height=200)

picture = Picture(app, image="guizero.gif", grid=[0,1])

width = Slider(app, command=resize, grid=[0,0], start=1, end=picture.width)
width.width = picture.width
width.value = picture.width

height = Slider(app, command=resize, horizontal=False, grid=[1,1], start=1, end=picture.height)
height.height = picture.height
height.value = picture.height

app.display()