将图像传递到iOS的颤振
我在flatter中生成一个图像,图像以字节为单位(定义为将图像传递到iOS的颤振,ios,swift,flutter,Ios,Swift,Flutter,我在flatter中生成一个图像,图像以字节为单位(定义为imageInMemory,它是一个UInt8列表)。然后我将字节传递给应用程序 UInt8List imageInMemory var argMap = <String, dynamic>{ "image" : imageInMemory, }; await platform.invokeMethod("passToNative", argMap); uint8在内存
imageInMemory
,它是一个UInt8列表)。然后我将字节传递给应用程序
UInt8List imageInMemory
var argMap = <String, dynamic>{
"image" : imageInMemory,
};
await platform.invokeMethod("passToNative", argMap);
uint8在内存中列出图像
变量argMap={
“图像”:imageInMemory,
};
wait platform.invokeMethod(“passToNative”,argMap);
我该如何从映射中获取参数并将其转换为快速的UIImage呢
提前感谢,,
方法频道中Swift侧的杰克:
guard let arguments = call.arguments as? [String:FlutterStandardTypedData],
let data:FlutterStandardTypedData = arguments["image"] else {
result("Couldn't find image data")
return
}
let uiImage = UIImage(data: data.data)!
// do something with uiImage