Using OpenCV with VC++ on Windows Forms Application
|
(On Microsoft Visual Studio) Using OpenCV with Console Application is easy and everywhere is full of information about that. When we run a Console Application Project, that black window will be open background while program is running. And we can not use Visual Studio’s drag&drop. Now let’s use OpenCV on a PictureBox on Windows Forms Application. I’m assuming you’re able to using OpenCV with Console Application already. Beginners must install OpenCV from here. Create a Windows Forms Application project and then go to project properties; Configuration Properties > General > Change Common Language Runtime Support to Common Language Runtime Support(/clr) Our project is ready for using OpenCV. And an example; Remove these lines from main cpp file. And put these; Now we’ve showed an image on a window which is created by us. And next example, let’s show a picture on Windows Form. Let’s create a Windows Form Application project and make that project property change. Open Form1.h and drag&drop a PictureBox on it. In the code view, put these codes below to PictureBox definations.
If we want to process that image, we’ll process img and than put on PictureBox’s image. Other warning: Don’t forget to include OpenCV libraries. Good coding. |
English Articles
Emrah Üstün
26 Aralık, 2008 saat 03:52
thanks bro,
cool tutorial
regards