12-20-2013 01:28 PM - edited 12-20-2013 01:41 PM
I need to get Contact image converted to Base64 string using BB 10 Webworks (blackberry.pim.contacts) as I am only getting the contact.photos.smallFilePath which is returning the file path from the phonebook.
Now i want to get image from this path and convert it into Base64 string.
var img = document.createElement('Image');
var canvas = document.createElement('Canvas');
canvas.width = img.width;
canvas.height = img.height;
var ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0);
This is returning wrong Base64 string of image for the first time. When i convert this string to image it displays white screen. But returns perfect string at secong time and after conversion, displays correct image.
I am using Blackberry Z10(OS 10) for testing .
i think canvas is not drawing image properly for the first time.
I searched and tried a lot but didn't get success.What will be the solution.
Thanks in Advance.
Solved! Go to Solution.
12-24-2013 11:57 AM