Click here to Skip to main content
15,891,184 members
Articles / Desktop Programming / Win32

An introduction to OpenCV (Part II): Implementing mouse events, manipulating images, and creating video clips

Rate me:
Please Sign up or sign in to vote.
4.58/5 (9 votes)
11 Feb 2013CPOL14 min read 76.9K   2.1K   43  
Shows how to use OpenCV to write videos, how to implement mouse events, and presents some commands on image manipulation as well.
//###### FILE DIALOG CLASS DEFINITIONS (by MKopp) ##########
//Common File Dialog //requires Multibyte string literals (see Project Properties)
//uses std::<map> and std::<string> 
class FileDialog
{
public: 
//Konstruktor //with Constructur list
	FileDialog(HWND parent_handle);
	~FileDialog(){}
//Methods
   //Shows Open File Dialog
	bool OpenFile();
   //Shows Save File Dialog
   bool SaveFile();
   //Opens Folder Only
   bool OpenFileEx();
   //returns Char Array of selected path
   char* Get_Name();

   //EXTRA: methods for loading and accessing files in a folder

   //fills all file names (strings the form -> string_number e.g. Benedict_16) of an folder into map
   void Store_Folders_FilesEx();
   //returns file name without path
   string Get_FilenameEx();
   //returns filenames of list
   string Get_Folder_FilenameEx();
   //returns File path  string
   string Get_PathNameEx();
   //returns size of list containing filenames
   int Get_Map_Size();

   //for testing purposes
   void PrintPathName(int posX, int posY);
   
private:
	OPENFILENAME my_ofn;
	//Struct for filename properties
	WIN32_FIND_DATA ffd;
	//Handle for found file
	HANDLE h_Find ;
	HWND my_hwnd;
	

	char szFileName[260];
	char Path_only[260];
	char *p_szFileName;

	//EXTRA: variables for laoding folder methods
	map<int,string> file_map;
	map<int,string>::iterator it;
	string path_name;
	string dummy_str;
	string file_name_only;
	
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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


Written By
Austria Austria
I try to be a behavioral scientist who uses his programming 'skills' to solve problems arising in the field of nonverbal communication.

Comments and Discussions