How to disable Maximize button in opencv-python

Viewed 73

I am using opencv-python or cv2 to access the mobile camera. The thing is that how to disable the maximize button in it for windows. You may give me an idea what to do my current code is-

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()

i have tried many online but none work Please update this code and help me out with this

1 Answers

Just googling by "How to disable Maximize button in opencv-python" gives the answer.

Not possible in OpenCV. The interface is more for debugging purposes. If you need the possibility to adapt GUI interfaces use a language designed for that like Qt.

The only idea is to check window size with:

cv2.getWindowImageRect('WindowName')

And if the size of window changes, then minimize it:

Minimize = win32gui.GetForegroundWindow()
win32gui.ShowWindow(Minimize, win32con.SW_MINIMIZE)
Related