当前位置:网站首页>flutter Uint8List格式的图片和File格式图片的互相转换
flutter Uint8List格式的图片和File格式图片的互相转换
2022-07-01 10:41:00 【氤氲息】
file格式图片转成Uint8List格式的图片
Uint8List imageByte;
imageByte = await widget.image.readAsBytes();
//将回调拿到的Uint8List格式的图片转换为File格式
SaveImage(Uint8List imageByte) async {
//获取临时目录
var tempDir = await getTemporaryDirectory();
//生成file文件格式
var file =
await File('${
tempDir.path}/image_${
DateTime.now().millisecond}.jpg')
.create();
//转成file文件
file.writeAsBytesSync(imageByte);
print("${file.path}");
setState(() {
path = file.path;
// turn(file);
_imageUint8=imageByte;
});
}
边栏推荐
- It is interesting to understand MMAP in this way!
- 大佬们 有没有搞过sink分流写入clickhouse 或者其他数据库的操作。
- 2022年已经过去一半了,是不是很突然呢?
- SQL SERVER2014删除数据库失败,报错偏移量0x0000...
- 106. construct binary tree from middle order and post order traversal sequence
- Infinite innovation in cloud "vision" | the 2022 Alibaba cloud live summit was officially launched
- JD and Tencent renewed the three-year strategic cooperation agreement; The starting salary rose to 260000 yuan! Samsung sk of South Korea competes for salary increase to retain semiconductor talents;
- Who's still buying three squirrels
- 使用强大的DBPack处理分布式事务(PHP使用教程)
- 基于Matlab的开环Buck降压斩波电路Simulink仿真电路模型搭建
猜你喜欢
Common penetration tools -goby
使用强大的DBPack处理分布式事务(PHP使用教程)
Zero foundation software testing must see, 10 years of testing old bird's conscience suggestions (a total of 15)
基于Matlab的开环Buck降压斩波电路Simulink仿真电路模型搭建
Design and practice of new generation cloud native database
It is interesting to understand MMAP in this way!
Sqlachemy common operations
[.net6] use ml.net+onnx pre training model to liven the classic "Huaqiang buys melons" in station B
投稿开奖丨轻量应用服务器征文活动(5月)奖励公布
Wireshark TS | confusion between fast retransmission and out of sequence
随机推荐
想开个户,在网上开华泰证券的户安全吗?
678. Valid bracket string
基于Matlab的开环Buck降压斩波电路Simulink仿真电路模型搭建
The exclusive collection of China lunar exploration project is limited to sale!
106. construct binary tree from middle order and post order traversal sequence
C one line code calculates the MD5 value of the file - codeplus series
C# [字节数组]与[16进制字符串]互相转换 - CodePlus系列
Suggest collecting | what to do when encountering slow SQL on opengauss?
In the new database era, don't just learn Oracle and MySQL
Crawler (2) - requests (1) | deep parsing of requests module
CRC 校验
【MPC】②quadprog求解正定、半正定、负定二次规划
Is it safe to buy funds on the access letter?
A new round of popularity of digital collections opens
Which securities company has a low, safe and reliable Commission for stock trading and account opening
CodeBlocks 左侧项目栏消失,workspace 自动保存项目,Default workspace,打开上次的workspace,工作区(图文教程,已解决)
Daily mathematics serial 55: February 24
中国探月工程独家藏品限量发售!
Want to open an account, is it safe to open an account of Huatai Securities online?
客户端如何请求数据库?