原型 C++: void setWindowProperty(const string& winname, int prop_id, double prop_value)
Parameters: |
|
---|
因此调用全屏,仅仅需要,且不用重新cmake
namedWindow("FullScreen",CV_WINDOW_NORMAL);
setWindowProperty("FullScreen", CV_WND_PROP_FULLSCREEN, CV_WINDOW_FULLSCREEN );
/*********************************************
*opencv可以设置全屏显示图片,具体代码如下
**********************************************/
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main()
{
Mat srcImage = imread("pic.jpg",2|4);
if (srcImage.empty())
{
cout << "srcImage load error\n" << endl;
system("pause");
exit(-1);
}
namedWindow("srcImage",CV_WINDOW_NORMAL);
setWindowProperty("srcImage", CV_WND_PROP_FULLSCREEN, CV_WINDOW_FULLSCREEN);
imshow("srcImage",srcImage);
waitKey(0);
}