Actually the question is: how can I transfer an image (Bitmap) From a program written in C # to the C ++ library. Thanks in advance for your answers.
1 answer
Like this, the declaration of a foreign function :) on C #
public class NativeMethods { [DllImport("mylib_dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)] // если возвращает bool/int/long.. [return: MarshalAs(UnmanagedType.Bool)] public static extern IntPtr myfunc(IntPtr mybitmap, int sizeOfBitmap); } Use this:
var aaa = NativeMethods.myfunc(bitmapBytes, bitmapBytes.length); |
curl. - NewView 5:41 pm