实现图片,无边缘显示的一个例子
#include "stdafx.h"
#include <iostream> // std::cout
#include <opencv2/core/core.hpp> // cv::Mat
#include <opencv2/highgui/highgui.hpp> // cv::imread()
using namespace std;
using namespace cv;
int main(int argc, char *argv[])
{
Mat input;
input = imread("d:\\1.jpg");
namedWindow("input", CV_WINDOW_AUTOSIZE);
moveWindow("input",0,0);
setWindowProperty("input", CV_WINDOW_FULLSCREEN, CV_WINDOW_FULLSCREEN);
imshow("input", input);
waitKey(0);
//setWindowProperty("input", CV_WINDOW_FULLSCREEN, CV_WINDOW_FULLSCREEN);
//moveWindow("input",-5,-20);
HWND win_handle = FindWindow(0, L"input");
if (!win_handle)
{
printf("Failed FindWindow\n");
}
// Resize
unsigned int flags = (SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER);
flags &= ~SWP_NOSIZE;
unsigned int x = 0;
unsigned int y = 0;
unsigned int w = input.cols;
unsigned int h = input.rows;
SetWindowPos(win_handle, HWND_NOTOPMOST, x, y, w, h, flags);
// Borderless
SetWindowLong(win_handle, GWL_STYLE, GetWindowLong(win_handle, GWL_EXSTYLE) | WS_EX_TOPMOST);
ShowWindow(win_handle, SW_SHOW);
//imshow("input",input);
waitKey(0);
return 0;
}