簡體   English   中英

如何在opencv-python中禁用最大化按鈕

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM