I am new to Angular and facing this issue.
I want to create a custom pipe for convert decimal codes into the base64 image then displaying them in views. I have complete code for this issue but don't know how to use it for the custom pipe.
This is my code:
my-component.ts
this.imgIn = "";
var chars1 = dataParkir.pictstart.data; // array of decimal codes
for (var k = 0; k < chars1.length; k++) {
var convert = String.fromCharCode(chars1[k]); // convert into base64
this.imgIn = this.imgIn + convert;
}
this.base64ImageIn = this.sanitizer.bypassSecurityTrustResourceUrl('data:image/png;base64,' + this.imgIn);
Has anyone else experienced this, please help me?