如何在私有类btnpr中添加我的static void mouse_callback? [英] How to add my static void mouse_callback in the private class btnpr?

查看:105
本文介绍了如何在私有类btnpr中添加我的static void mouse_callback?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试添加

  static   void  mouse_callback(< span class =code-keyword> int   event  int  x, int  y, int  void  *)

在私有类

 private:System :: Void btnpr_Click(System :: Object ^ sender,System :: EventArgs ^ e)

我在Visual Studio +中工作OpenCV + WindowsForms

或者如果有人知道如何在Windows窗体c ++中添加感兴趣区域(OpenCV)?

谢谢。



我尝试过:



我尝试添加下一个表格的这个类:

 setMouseCallback(System valuate,mouse_callback); 

但它给我一个void和cv :: MouseCallback之间的兼容性错误

解决方案

该函数不正确接口。有一个int很多:

  static   void  mouse_callback( int   event  int  x, int  y, void  * data); 

另请阅读<在Github上的一个href =https://github.com/opencv/opencv/blob/master/samples/cpp/ffilldemo.cpp>示例。

要指定一个地区你检查正常鼠标处理函数中的坐标


Hi,I try to add

static void mouse_callback(int event, int x, int y, int, void *)

in the private class

private: System::Void btnpr_Click(System::Object^  sender, System::EventArgs^  e)

I am working in Visual Studio+OpenCV+WindowsForms
Or if someone know how to add Region of Interest (OpenCV) in Windows Forms c++?
Thanks.

What I have tried:

I try to add this class of the next form:

setMouseCallback("System valuate", mouse_callback);

But it gives me a compatibility error between void and cv :: MouseCallback

解决方案

The function has a not correct interface. There is an int to much:

static void mouse_callback(int event, int x, int y, void *data);

Read also this example on Github.
To specify an region you check the coordinates in the normal mouse handler function.


这篇关于如何在私有类btnpr中添加我的static void mouse_callback?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆