【发布时间】:2020-10-07 19:22:59
【问题描述】:
在nativescript应用上工作,需要访问图像并将其转换为base64。
.then(function(selection) {
selection.forEach(function (selected) {
imageSourceModule
.fromAsset(selected)
.then((imageSource) => {
var imageBase64 = imageSource.toBase64String("jpg",60);
console.log(imageBase64);
【问题讨论】:
-
它是递归的,因此,您可能需要在对资产进行 操作之前找到资产。换句话说,你的外部代码块比你的内部代码块运行得更快。
标签: angular nativescript imagesource