void* bufftempSize = stackalloc uint[TemplateSize];
byte[] blob = new byte[TemplateSize];
Manager.ATBuildMatchTemplate(pImageItem,bufftempSize);
Marshal.Copy((IntPtr) bufftempSize,blob,0,TemplateSize);
I am using the code above to read from memory block. It seems to work except the template that I read back from the array is not right. I think it has something to do with Marshal.Copy().(Changing from managed to unmanaged) Is there a way I can copy the memory to an array without Marshalling?
byte[] blob = new byte[TemplateSize];
Manager.ATBuildMatchTemplate(pImageItem,bufftempSize);
Marshal.Copy((IntPtr) bufftempSize,blob,0,TemplateSize);
I am using the code above to read from memory block. It seems to work except the template that I read back from the array is not right. I think it has something to do with Marshal.Copy().(Changing from managed to unmanaged) Is there a way I can copy the memory to an array without Marshalling?