From ca10782397cf71280908c64e4312582122b29b26 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Sun, 8 Dec 2019 09:16:55 -0500 Subject: [PATCH 1/2] Simple OpenCV demo ported to PyDroid3 --- DemoPrograms/PyDroid3/Demo_OpenCV_4_Line_Program.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 DemoPrograms/PyDroid3/Demo_OpenCV_4_Line_Program.py diff --git a/DemoPrograms/PyDroid3/Demo_OpenCV_4_Line_Program.py b/DemoPrograms/PyDroid3/Demo_OpenCV_4_Line_Program.py new file mode 100644 index 00000000..a3197a25 --- /dev/null +++ b/DemoPrograms/PyDroid3/Demo_OpenCV_4_Line_Program.py @@ -0,0 +1,5 @@ +import tkinter +import cv2, PySimpleGUI as sg +window, cap = sg.Window('Demo Application - OpenCV Integration', [[sg.Image(filename='', key='image')], ], location=(800, 400)), cv2.VideoCapture(0) +while window(timeout=20)[0] is not None: + window['image'](data=cv2.imencode('.png', cap.read()[1])[1].tobytes()) From fa24ab4607f15bbfb46c9f06b28e023baace166a Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Sun, 8 Dec 2019 09:17:42 -0500 Subject: [PATCH 2/2] Set location to 0,0 --- DemoPrograms/PyDroid3/Demo_OpenCV_4_Line_Program.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DemoPrograms/PyDroid3/Demo_OpenCV_4_Line_Program.py b/DemoPrograms/PyDroid3/Demo_OpenCV_4_Line_Program.py index a3197a25..b7cd3904 100644 --- a/DemoPrograms/PyDroid3/Demo_OpenCV_4_Line_Program.py +++ b/DemoPrograms/PyDroid3/Demo_OpenCV_4_Line_Program.py @@ -1,5 +1,5 @@ import tkinter import cv2, PySimpleGUI as sg -window, cap = sg.Window('Demo Application - OpenCV Integration', [[sg.Image(filename='', key='image')], ], location=(800, 400)), cv2.VideoCapture(0) +window, cap = sg.Window('Demo Application - OpenCV Integration', [[sg.Image(filename='', key='image')], ], location=(0, 0)), cv2.VideoCapture(0) while window(timeout=20)[0] is not None: window['image'](data=cv2.imencode('.png', cap.read()[1])[1].tobytes())