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

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -