[]QQ玩一玩 获取头像后的数据是 BK.Buffer,需要如何用laya的Image显示出来?
如下代码是玩一玩获取头像的代码, BufferInfo.buffer 是 BK.Buffer 类型,需要如何用laya的Image显示出来?
function callback(openID, BuffInfo){
if(openID == openID1)
{
var buff = BuffInfo.buffer;
var width = BuffInfo.width;
var height = BuffInfo.height;
BK.Script.log(0,0,"headeBuff :"+ openId + " buff:"+ buff + " width:"+ width +" height:"+height);
var tex = new BK.Texture(buff,width,height);
var sp =new BK.Sprite(200,200,tex,0,1,1,1);
BK.Director.root.addChild(sp);
}else if(openID == openID2){
...
}
}
BK.MQQ.Account.getHead(openID1, callback);
BK.MQQ.Account.getHead(openID2, callback);
===============================================================
[b]问题已解决,传送门:[/b]https://ask.layabox.com/question/17032
没有找到相关结果
已邀请:
要回复问题请先登录
5 个回复
w1114367261
赞同来自:
0℃
赞同来自:
*%〈~〉
赞同来自:
Six.Sir
赞同来自:
152*****351
赞同来自:
var succ = BK.Image.saveImage(BuffInfo.buffer, BuffInfo.width, BuffInfo.height, '' + openID, '.png');
this.imgHead.skin = '' + openID + '.png';