Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I got this code on my app which tries to get contact thumbnail. But I don't know how to render that thumbnail.

JavaScript
Windows.ApplicationModel.Contacts.ContactManager.requestStoreAsync()
   .then(function (cs) {
       cs.findContactsAsync(strSearch).then(function (list) {
              //Hope being right
           list[0].thumbnail.openReadAsync().done(function (thmb) {
              //this is the part when I get lost
           });
       })
   }, function () {
       console.log(arguments);
   });


Can someone help me please???!!!
Posted
Updated 24-Mar-16 9:52am
v3

1 solution

Windows.ApplicationModel.Contacts.ContactManager.requestStoreAsync()
   .then(function (cs) {
       cs.findContactsAsync(strSearch).then(function (list) {
              //Hope being right
           list[0].thumbnail.openReadAsync().done(function (thmb) {
                with (new FileReader) {
                    onloadend = function () {
                       data.picture = 'url(' + result + ')';
                       postMessage(data);
                    };
                    readAsDataURL(MSApp.createBlobFromRandomAccessStream("image/png", thmb));//solucion definitiva
                }
           });
       })
   }, function () {
       console.log(arguments);
   });
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900