当前位置:网站首页>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;
});
}
边栏推荐
- The exclusive collection of China lunar exploration project is limited to sale!
- 4hutool practice: dateutil format time [easy to understand]
- Daily mathematics serial 55: February 24
- 《百年巨匠》数字藏品中奖名单公布
- [.net6] use ml.net+onnx pre training model to liven the classic "Huaqiang buys melons" in station B
- NC | 肠道细胞和乳酸菌共同作用来防止念珠菌感染
- 使用强大的DBPack处理分布式事务(PHP使用教程)
- Ask everyone in the group about the fact that the logminer scheme of flick Oracle CDC has been used to run stably in production
- . Net 5.0+ does not need to rely on third-party native implementation of scheduled tasks
- I'd like to know where I can open an account in Guangzhou? Is it safe to open an account online now?
猜你喜欢
![[.net6] use ml.net+onnx pre training model to liven the classic](/img/b3/b117481fba7257453011e4cdb1eaaa.png)
[.net6] use ml.net+onnx pre training model to liven the classic "Huaqiang buys melons" in station B

数据库的增删改查问题

C one line code calculates the MD5 value of the file - codeplus series
![[paper reading] trajectory guided control prediction for end to end autonomous driving: a simple yet strong Ba](/img/fa/f2d24ee3dbbbe6332c84a82109338e.png)
[paper reading] trajectory guided control prediction for end to end autonomous driving: a simple yet strong Ba

北汽蓝谷:业绩承压,极狐难期

Error: missing revert data in call exception

移动硬盘驱动器读到,但不显示盘符

What should I learn in the zero foundation entry test? It's the most comprehensive. Just learn from it
![[encounter Django] - (II) database configuration](/img/23/aed472757f7e238a146b043c0405d7.png)
[encounter Django] - (II) database configuration

It is interesting to understand MMAP in this way!
随机推荐
Is it safe to buy funds on the access letter?
选择在中金证券上炒股开户可以吗?安全吗?
Error: missing revert data in call exception
[.NET6]使用ML.NET+ONNX预训练模型整活B站经典《华强买瓜》
【MPC】②quadprog求解正定、半正定、负定二次规划
Sqlachemy common operations
.NET 5.0+ 无需依赖第三方 原生实现定时任务
Rising Stars in Plant Sciences (RSPS2022) Finalist科学演讲会(6.30晚9点)
Does anyone know the logic of limit statement execution in Clickhouse? In the picture, the SQL above can be executed successfully
使用强大的DBPack处理分布式事务(PHP使用教程)
[MPC] ② quadprog solves positive definite, semi positive definite and negative definite quadratic programming
新品大揭秘!雅迪冠能 3 多元产品矩阵,满足全球用户出行需求
[dark horse morning post] Yu Minhong said he never looked at the stock price of New Oriental; Hengchi 5 will start pre-sale in July; Naixue virtual stock or suspected of illegal fund-raising; From Jul
SQL SERVER2014删除数据库失败,报错偏移量0x0000...
MySQL common commands
Valgrind usage of memory leak locating tool
CRC check
Does anyone know why? The table structure is the source table MySQL CDC that has just been directly copied
Japanese professor sues Intel FPGA and SOC products for infringing a design patent
Zero foundation software testing must see, 10 years of testing old bird's conscience suggestions (a total of 15)