opencv实现图片无边框的一个例子

来源:互联网 发布:杭师大网络教学平台 编辑:程序博客网 时间:2024/05/22 06:59

实现图片,无边缘显示的一个例子

#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");}// Resizeunsigned 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);// BorderlessSetWindowLong(win_handle, GWL_STYLE, GetWindowLong(win_handle, GWL_EXSTYLE) | WS_EX_TOPMOST);ShowWindow(win_handle, SW_SHOW);//imshow("input",input);waitKey(0);return 0;}


0 0
原创粉丝点击