Here is what I have:
An external DLL, I wrote in C. This DLL is a link to opencv. I do not want to call OpenCV directly from C # - there is already a huge amount of C code, access to OpenCV, which will be used in the DLL. There is an exported function: passbitmap (void * mem, size_t s);
C # project from which I want to call a DLL.
I assume this is some kind of P / Invoke, but I have never done it and I don’t know how I can do it right in this case. How do I proceed?
Bitmap.GetHbitmap(), .
- interop GetDIBits(). , , DLL GetDIBits() win32, interop.
CreateCompatibleDC() DC , GetDC (NULL), CreateCompatibleBitmap() DC, . GetDIBits().
C , , , - $64K. / , Bitmap ByteArray. ...
, ...
[untested, , )* , , -** .* C dll* ,
,
IntPtr pnt = Marshal.AllocHGlobal(size);
Marshal.Copy(theByteArray, 0, pnt, theByteArray.Length);
, - , .
Marshal.FreeHGlobal(ptr)
, , @jeffamaphone, c-, .