本文整理汇总了TypeScript中ikagaka.shell.js.SurfaceUtil.fetchImageFromArrayBuffer方法的典型用法代码示例。如果您正苦于以下问题:TypeScript shell.js.SurfaceUtil.fetchImageFromArrayBuffer方法的具体用法?TypeScript shell.js.SurfaceUtil.fetchImageFromArrayBuffer怎么用?TypeScript shell.js.SurfaceUtil.fetchImageFromArrayBuffer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ikagaka.shell.js.SurfaceUtil
的用法示例。
在下文中一共展示了shell.js.SurfaceUtil.fetchImageFromArrayBuffer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: switch
let promises = hits.map((filepath)=>{
let buffer = directory[filepath];
return SurfaceUtil.fetchImageFromArrayBuffer(buffer)
.then((png)=>{
let cnv = SurfaceUtil.pna({cnv: null, png, pna: null}).cnv;
if(/^balloon([ksc])(\d+)\.png$/.test(filepath)){
let [__, type, n] = /^balloon([ksc])(\d+)\.png$/.exec(filepath);
switch (type){
case "s": balloons.sakura[Number(n)] = {canvas: cnv, descript:{}}; break;
case "k": balloons.kero[Number(n)] = {canvas: cnv, descript:{}}; break;
case "c": balloons.communicate[Number(n)] = {canvas: cnv, descript:{}}; break;
}
}else if( /^online(\d+)\.png$/.test(filepath)){
let [__, n] = /^online(\d+)\.png$/.exec(filepath);
balloons.online[Number(n)] = {canvas: cnv, descript:{}};
}else if( /^arrow(\d+)\.png$/.test(filepath)){
let [__, n] = /^arrow(\d+)\.png$/.exec(filepath);
balloons.arrow[Number(n)] = {canvas: cnv, descript:{}};
}else if( /^sstp\.png$/.test(filepath)){
balloons.sstp = {canvas: cnv, descript:{}};
}else if( /^thumbnail\.png$/.test(filepath)){
balloons.thumbnail = {canvas: cnv, descript:{}};
}
});
});