I was wondering how you would store the cropped image as a base64 string in a variable. Here's my fileChangeListener code:
`fileChangeListener($event) {
var image:any = new Image();
var file:File = $event.target.files[0];
var myReader:FileReader = new FileReader();
var that = this;
var imageResult:string;
myReader.onloadend = function (loadEvent:any) {
image.src = loadEvent.target.result;
imageResult = image.src;
that.employee.binaryPhoto =image.src+"";
};
myReader.readAsDataURL(file);
}`
This code populates the employee object's binaryPhoto property with the base64 image string. However, this is the image string for the original uploaded image. How do I store the base64 string for the cropped image?
Hey
I was wondering how you would store the cropped image as a base64 string in a variable. Here's my fileChangeListener code:
This code populates the employee object's binaryPhoto property with the base64 image string. However, this is the image string for the original uploaded image. How do I store the base64 string for the cropped image?