Hi,
I want to convert image object url image to binary, but unable to do so, as further i have to conver it to base64.
I am not getting help from anywhere, i tried alot, thanks in advance.
i m trying like this
var buffer_data = imageObject.toArrayBuffer();
but when i convert it into base64 it do not convert properly
with the fnc below. but if any string i want to convert, it converts properly
function arrayBufferToBase64( buffer ) {
var binary = '';
var bytes = new Uint8Array( buffer );
var len = bytes.byteLength;
for (var i = 0; i < len; i++) {
binary += String.fromCharCode( bytes[ i ] );
}
return Qt.btoa( binary );
}
Please help. i am stuck in it from last 3weeks