c++ cli - Pass native array as managed array from C++/CLI -


i have 3rd party lib controls camera. written in c++ , want consume c#. lib grabs image byte*. there ways pass c#.

  1. pass byte* directly c# unsafe statement. in case, c# code can't change image size crop operation.
  2. use marshal.copy create managed byte array , pass it. gives flexibility c#, there overhead , additional memory usage.

so, question is:
there way convert byte* managed byte[] without copy? because managed byte array fixed statement "blittable", think there can "reverse direction" method.

any appreciated, thank you.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -