Ask Your Question

Revision history [back]

Passing C++ cv::Mat to Image in C#

Hello

I need to pass an cv::Mat (RGB Image without alpha) to a Image Class in C#. For this, I have created a DLL where I can call the C++ code from C#. Using emguCv is no option.

One option would be to save the image in C++ and to reopen the image in C#. But I would like to pass the image by reference (Pointer). For C++ datatype would be char* and in C# IntPtr right?

There are similiar questions but all of these cann't help me.

https://social.msdn.microsoft.com/Forums/vstudio/en-US/870f0aa2-953d-41ea-b5f3-3625a43042ce/how-to-pass-binary-data-from-c-dll-to-a-c-application-via-interop?forum=clr

Thanks a lot and regards Roberto