-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathimage_control.py
More file actions
42 lines (36 loc) · 1.17 KB
/
image_control.py
File metadata and controls
42 lines (36 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import pglet
from pglet import Text, Image
def main(page):
page.title = "Images example"
page.gap = 20
page.update()
page.add(
Image(
src="https://via.placeholder.com/350x150",
title="sample image",
alt="Example with no image fit value and no height or width is specified.",
),
Image(
src="https://via.placeholder.com/350x150",
width=600,
title="sample image",
alt="Example with no image fit value and only width is specified.",
),
Image(
src="https://via.placeholder.com/350x150",
height=100,
title="sample image",
alt="Example with no image fit value and only height is specified.",
),
Image(
src="https://via.placeholder.com/350x150",
width=100,
height=100,
title="sample image",
alt="Example with no image fit value and height or width is specified.",
),
)
page.add(
Image(src='https://via.placeholder.com/350x150', title='sample image', fit='cover')
)
pglet.app("python-image", target=main)