Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi. First of all, you should use the C++ API instead of the old C API. The C API is marked as deprecated (see here).

This is your example in C++:

  cv::Mat img = cv::imread("jpgTest.jpg");
  cv::namedWindow("Image", cv::WINDOW_AUTOSIZE);
  cv::imshow("Image", img);
  cv::waitKey();

The second parameter of cv::namedWindow changes the behavior of the window (see here).

If you want to position the window at a certain location on the scree or want to resize the window use cv::moveWindow() and cv::resizieWindow().