Advertisement
dan-masek

Untitled

Jun 28th, 2024
738
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. import cv2
  2. import numpy as np
  3.  
  4. frame = np.zeros((240, 320, 3), np.uint8)
  5. window = "Test Window"
  6.  
  7. def show_window(window, frame):
  8.     print(cv2.getWindowProperty(window, cv2.WND_PROP_TOPMOST))
  9.     while(True):
  10.         cv2.imshow(window, frame)
  11.         if cv2.waitKey() > 0:
  12.             break
  13.  
  14. cv2.namedWindow(window)
  15.  
  16. cv2.setWindowProperty(window, cv2.WND_PROP_TOPMOST, 1)
  17. show_window(window, frame)
  18.  
  19. cv2.setWindowProperty(window, cv2.WND_PROP_TOPMOST, 0)
  20. show_window(window, frame)
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement