[英]How to disable Maximize button in opencv-python
我正在使用 opencv-python 或 cv2 来访问移动摄像头。 问题是如何为 Windows 禁用其中的最大化按钮。 您可能会给我一个想法,我当前的代码是-
import requests
import cv2
import numpy as np
import imutils
print('Install Ip Ip Webcam in Play store and click on start server.NOTE: connect the mobile to the same wifi as the pc')
url = (f"{source}/shot.jpg")
while True:
img_resp = requests.get(url)
img_arr = np.array(bytearray(img_resp.content), dtype=np.uint8)
img = cv2.imdecode(img_arr, -1)
img = imutils.resize(img, width=1000, height=1800)
cv2.imshow("Mobi-CCTV", img)
if cv2.waitKey(1) == ord('q'):
break
cv2.destroyAllWindows()
我已经尝试了很多在线但没有工作请更新此代码并帮助我解决这个问题
只需通过“如何在 opencv-python 中禁用最大化按钮”进行谷歌搜索即可给出答案。
在 OpenCV 中是不可能的。 该接口更多用于调试目的。 如果您需要适应 GUI 界面的可能性,请使用专为 Qt 设计的语言。
唯一的想法是检查窗口大小:
cv2.getWindowImageRect('WindowName')
如果窗口大小发生变化,则将其最小化:
Minimize = win32gui.GetForegroundWindow()
win32gui.ShowWindow(Minimize, win32con.SW_MINIMIZE)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.