Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
inherited_properties_test(a, lambda: Picture(a), False)
a.destroy()
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()
def test_color():
a = App()
p = Picture(a)
color_test(p)
a.destroy()
def test_after_schedule():
a = App()
p = Picture(a)
schedule_after_test(a, p)
a.destroy()
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()
def test_enable():
a = App()
p = Picture(a)
enable_test(p)
a.destroy()
from guizero import App, Picture
app = App()
picture = Picture(app, image="guizero.gif")
picture_png = Picture(app, image="guizero.png")
app.display()
# 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()
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
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()