如何在我的winrt-javascript应用程序上显示联系人缩略图? [英] How to show a contact thumbnail on my winrt-javascript app?
本文介绍了如何在我的winrt-javascript应用程序上显示联系人缩略图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的应用程序上有这个代码,试图获取联系人缩略图。但我不知道如何渲染缩略图。
Windows.ApplicationModel.Contacts.ContactManager.requestStoreAsync()
.then( function (cs){
cs.findContactsAsync(strSearch).then( function (列表){
// 希望是正确的
list [ 0 ]。thumbnail.openReadAsync()。done( function (thmb){
// 这是我迷路的部分
});
})
}, function (){
console .log(arguments);
});
有人可以帮我吗??? !!!
解决方案
的Windo ws.ApplicationModel.Contacts.ContactManager.requestStoreAsync()
.then(function(cs){
cs.findContactsAsync(strSearch).then(function(list){
// Hope is right
list [0] .thumbnail.openReadAsync()。done(function(thmb){
with(new FileReader){
onloadend = function(){
data.picture = 'url('+ result +')';
postMessage(数据);
};
readAsDataURL(MSApp.createBlobFromRandomAccessStream(image / png,thmb)); // solucion definitiva
}
});
})
},function(){
console.log(arguments);
});
I got this code on my app which tries to get contact thumbnail. But I don't know how to render that thumbnail.
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???!!!
解决方案
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); });
这篇关于如何在我的winrt-javascript应用程序上显示联系人缩略图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文