首页 > 解决方案 > 如何将 ByteArray 从本机 iOS 库导出到 Xamarin 绑定库?

问题描述

本机 iOS 库 API: - void getCamImage(Byte[])data withWidth:(size_t)width withHeight:(size_t)height withStride:(size_t)stride ;

在 Binding DLL 项目中,我尝试了以下操作: [Export("getCamImage:withWidth:withHeight:withStride:")] void GetCamImage(Byte[] buffer, int width, int height, int stride);

尝试使用 byte[] 而不是 Byte[]。出现以下错误:错误 CS0452:类型“字节”必须是引用类型才能将其用作泛型类型或方法“NSArray.FromNSObjects(params T[])”中的参数“T”

问题:如何将 ByteArray 参数导出为?

标签: xamarinxamarin.formsdata-bindingxamarin.ios

解决方案


推荐阅读