Converting a png/jpg to .ico in javascript
问题 So i want a tool that generates a .ico file from a jpg/png. I have generated the jpg from a canvas using this code: var img = c.toDataURL("image/png"); document.write('<img src="'+img+'"/>'); Which takes from this canvas: <canvas id="myCanvas" width="16" height="16"> So the qustion is; is it possible to convert the generated png to a ico? 回答1: In Firefox you can do this directly from canvas: // Make ICO files (Firefox only) var ctx = c.getContext("2d"); ctx.arc(c.width>>1, c.height>>1, c