I am making a reactjs app in electron and nodejs and as part of that am converting robotjs screenshots into base64 strings. However, when I try to print the var b64, it says data:image/png;base64,undefined. Here is the code for it:
const img = robot.screen.capture().image;
var b64 = img.toString('base64')
document.getElementById("remoteControlScreen").src = "data:image/png;base64," + b64;
Please help!