问题描述
extern"C"{DLLIMPORTintAWB_7807B(intfive_pattern_mode,doublefive_pattern_data[50],doublex[256],doubley[256],doubleL[256],doubleGVDDP,doubleGVDDN,doubleVGS,intgamma_setting_bf[180],intgamma_setting_af[180],doubleuser_define_x,doubleuser_define_y,doubleGamma,intcontrast_mode,doublemin_lux,doubleerror_range,doubleW255_xy[2],doubleresult_xyL[3][256]}gamma_setting_afW255_xyresult_xyL是要随着函数改变的,意味着ref/outC#怎么调用???
解决方案
解决方案二:
//C#中直接使用一维数据处理。//如:doubleresult_xyL[3][256],[MarshalAsAttribute(UnmanagedType.ByValArray,SizeConst=3*256)]publicdouble[]result_xyL;
解决方案三:
试一下在C#中定义相同的空间,然后用IntPtr类型传入C语言.数组转成IntPtr参考这段代码publicstaticvoidGetBytePtr(refbyte[]buff){GCHandlegc=GCHandle.Alloc(buff,GCHandleType.Pinned);IntPtrp=gc.AddrOfPinnedObject();///在此处调用C函数gc.Free();}