Click here to Skip to main content
15,916,692 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi, i have a task to capture desktop or activewindow using OPENCV as video source, but the result gives infinite-mirror-efect in the output video, someone says it have something to do with the GetDesktopWindow , also i have a function that create a bitmap from the screen image called hwnd2mat
this is inside main :
C#
HWND hwndDesktop = GetDesktopWindow();	
	int key = 0;
	while (key != 30 )
	{
		Mat src = hwnd2mat(hwndDesktop);		
		// you can do some image processing here
		imshow("output", src);
		key = waitKey(30); // you can change wait time
	}
	ReleaseCapture();
	destroyAllWindows();
	return 0;


What I have tried:

i change GetDesktopWindow() with FindWindow() or FindWindowEx() and using Spy++ to find the Class of i don't know what, but i don't know example how i do that, could you please give me an example or a solution for this? appreciate it very much, i've been struggling with this for 2 days.
Posted
Updated 19-Apr-16 6:32am

1 solution

 
Share this answer
 
Comments
Member 12465269 19-Apr-16 12:59pm    
no you don't understand, i've already manage all the effort to trying this from google and stackoverflow, OPENCV it self doesn't have source option desktop screen as source, so, the function is custom
Richard MacCutchan 20-Apr-16 2:43am    
Sorry, I don't understand what your problem is.
Member 12465269 20-Apr-16 8:01am    
it's ok man, i finally managed the solution, but it gives me another bug.. darn..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900