Skip to content

Commit

Permalink
optimize show
Browse files Browse the repository at this point in the history
  • Loading branch information
Neutree committed May 31, 2024
1 parent b384701 commit 4c7401b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions projects/app_rtmp_live/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
str_btn_tips = 'touch to scan qrcode'
str_no_url_tips1 = 'Get RTMP server address from live platforms'
str_no_url_tips2 = 'Generate QRCode with server address'
str_scan_tips1 = '1. Get RTMP server addr from live platforms'
str_scan_tips1 = '1. Get RTMP server addr from live platform'
str_scan_tips2 = ' format like rtmp://xxx.com/app/stream'
str_scan_tips3 = '2. Generate QRCode with server addr, scan'

Expand Down Expand Up @@ -92,8 +92,8 @@ def parse_url(url):

if len(global_url) == 0:
color = image.Color.from_rgb(0x6e, 0x6e, 0x6e)
base_img.draw_string(base_img.width()//2 - image.string_size(str_no_url_tips1, 2).width()//2, int(base_img.height() * 0.15), str_no_url_tips1, color, 1.5)
base_img.draw_string(base_img.width()//2 - image.string_size(str_no_url_tips2, 1.5).width()//2, int(base_img.height() * 0.15) + str_height_2 + 10, str_no_url_tips2, color, 1.5)
base_img.draw_string(base_img.width()//2 - image.string_size(str_no_url_tips1, 1.5).width()//2, img_exit.height() + 15 , str_no_url_tips1, color, 1.5)
base_img.draw_string(base_img.width()//2 - image.string_size(str_no_url_tips2, 1.5).width()//2, img_exit.height() + 15 + str_height_2 + 10, str_no_url_tips2, color, 1.5)
box = [base_img.width()//2-img_scan.width()//2, base_img.height()//2-50, 100, 100]
if touch_box(t, box):
base_img.draw_image(box[0], box[1], img_scan)
Expand Down Expand Up @@ -169,9 +169,9 @@ def parse_url(url):
else:
img.draw_image(box[0], box[1], img_exit)

img.draw_string(20, int(img.height() * 0.75), str_scan_tips1, image.Color.from_rgb(0x6e, 0x6e, 0x6e), 2)
img.draw_string(20, int(img.height() * 0.75) + str_height_2 + 10, str_scan_tips2, image.Color.from_rgb(0x6e, 0x6e, 0x6e), 2)
img.draw_string(20, int(img.height() * 0.75) + (str_height_2 + 10) * 2, str_scan_tips3, image.Color.from_rgb(0x6e, 0x6e, 0x6e), 2)
img.draw_string(0, int(img.height() - (str_height_2 * 3 + 3 * 4)), str_scan_tips1, image.Color.from_rgb(0x6e, 0x6e, 0x6e), 2)
img.draw_string(0, int(img.height() - (str_height_2 * 3 + 3 * 4)) + str_height_2 + 4, str_scan_tips2, image.Color.from_rgb(0x6e, 0x6e, 0x6e), 2)
img.draw_string(0, int(img.height() - (str_height_2 * 3 + 3 * 4)) + str_height_2 * 2 + 4*2, str_scan_tips3, image.Color.from_rgb(0x6e, 0x6e, 0x6e), 2)
disp.show(img)
del cam
cam = None
Expand Down

0 comments on commit 4c7401b

Please sign in to comment.