Skip to content

Commit

Permalink
no tk, bake in screen res
Browse files Browse the repository at this point in the history
  • Loading branch information
bpurinton committed Sep 7, 2020
1 parent f5fecc7 commit 899e20c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions PCfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ def resizeWin(img, resize_factor=0.7):
must be in the range (0, 1].
"""
# this import needs to be within the function or else openCV throws errors
import tkinter as tk
root = tk.Tk()
# import tkinter as tk
# root = tk.Tk()
# resize_factor = (1 - resize_factor) + 1
# sys_w, sys_h = root.winfo_screenwidth()/resize_factor, root.winfo_screenheight()/resize_factor
# root.destroy()
# root.quit()
# del root
resize_factor = (1 - resize_factor) + 1
sys_w, sys_h = root.winfo_screenwidth()/resize_factor, root.winfo_screenheight()/resize_factor
root.destroy()
root.quit()
del root
# sys_w, sys_h = 1280/resize_factor, 720/resize_factor
sys_w, sys_h = 1920/resize_factor, 1080/resize_factor
scale_width = sys_w / img.shape[1]
scale_height = sys_h / img.shape[0]
dimensions = min(scale_width, scale_height)
Expand Down
Binary file modified __pycache__/PCfunctions.cpython-37.pyc
Binary file not shown.

0 comments on commit 899e20c

Please sign in to comment.