我是一个RadListView的输出,每个项目都有一个以Base64格式编码的图像,但我无法正确显示它们。
在组件循环中,我有:
但我不知道该如何理解这行代码。
在组件循环中,我有:
let base64ImageSource = new ImageSource;
base64ImageSource = fromBase64(returned_expenses[i].receipt_data);
在模板中我有
<Image row="0" col="1" [src]="base64ImageSource" horizontalAlignment="right" width="100" height="100" stretch="none"></Image>
并且没有图片。
我看到了下面的代码
this.imageSource = new ImageSource();
var loadedBase64 = this.imageSource.loadFromBase64(MY_BASE_64_STRING_PREVIOUSLY_SAVED);
console.log(loadedBase64);
if (loadedBase64) {
let photo = <Image>this.photoImage.nativeElement;
photo.imageSource = this.imageSource;
this.photo = photo;
}
但我不知道该如何理解这行代码。
let photo = <Image>this.photoImage.nativeElement;
例如,photoImage被声明为什么?
感谢任何指导!