title: How to display an image in full screen borderless window in openCV
body: <p>I want to display an image in OpenCV in a full screen borderless window.
  In other words, only the image pixels will appear, without menu, toolbar, or window background. </p>
  
  <p>Using <code>imshow()</code> or <code>cvShowImage()</code> don't enable it:</p>
  
  <ol>
  <li>The window grows to be full screen
  in width but not in height. It misses few pixels.</li>
  <li>I could not make it borderless even by changing settings of window
  handler.</li>
  </ol>
  
  <p>I think that the problem is rooted in <code>cvNamedWindow()</code> method which creates main <code>WS_OVERLAPPED</code> window, then creates a child and all functions like <code>imshow()</code> or <code>cvGetWindowHandle()</code> operate on the child.</p>
  
  <p>Thus even windows command:</p>
  
  <pre><code>SetWindowLong((HWND)cvGetWindowHandle(winName), GWL_STYLE, WS_VISIBLE | WS_EX_TOPMOST | WS_POPUP);
  </code></pre>
  
  <p>Doesnt help, since the child cannot become borderless <code>WS_POPUP</code>. Someone got a workaround?</p>
  
  <ul>
  <li>Maybe, showing opencv mat to window
  without using opencv built in methods</li>
  <li>Or some kind of windows trick</li>
  </ul>
  
  <p>P.S. I tried the following code:</p>
  
  <pre><code>cvMoveWindow("AAA",0,0);
  cvSetWindowProperty("AAA", CV_WINDOW_FULLSCREEN, CV_WINDOW_FULLSCREEN);
  
  // Also I tried this:
  HWND hwnd = (HWND)cvGetWindowHandle("AAA");
  RECT windowRect;
  windowRect.left = 0;
  windowRect.top = 0;
  windowRect.right = cxScreen; //Display resolution
  windowRect.bottom = cyScreen; //Display resolution
  AdjustWindowRect(&amp;windowRect,WS_VISIBLE,false);
  long p_OldWindowStyle = SetWindowLongPtr(hwnd,GWL_STYLE,WS_POPUP);
  SetWindowPos(hwnd,HWND_TOP,0,0,windowRect.right,windowRect.bottom,SWP_FRAMECHANGED | SWP_SHOWWINDOW);
  SetWindowLong(hwnd, GWL_STYLE, WS_VISIBLE | WS_EX_TOPMOST | WS_POPUP); 
  </code></pre>