I have created an input feature that allows me to paste images by using CTRL-V.
The process involves copying an image from the browser and pasting it into the input field using CTRL-V. The result is an image in base64 format. Is there a way to manipulate this image, transforming it to have a height and width of 600 pixels?
In other words, I want to resize the received image to be 600x600 pixels. I have attempted various methods utilizing Canvas but have not been successful.
Could someone provide assistance with this task?
Code
@HostListener("paste", ["$event"])
onPaste(e: ClipboardEvent) {
let clipboardData = e.clipboardData || (window as any).clipboardData;
let pastedData = clipboardData.getData("text");
console.log(pastedData)
}