use actionscript to convert favicon to png?
Using actionscript 3, how can I convert the favicon of a website to a 16x16 .png file?
this solution must specifically NOT access online services such as http://www.google.co开发者_运维技巧m/s2/favicons?domain=
The approach I would take is to bring in the ico file (assuming your favicons are ico files) as BitmapData. Then format the bitmap data as a PNG file. Here are some links I found to do just that. Alternatively, you could build your own solution but that would certainly be the long way round.
Importing ico files as bitmaps:
http://ntt.cc/2008/10/02/using-icodecoder-class-to-read-ico-file-and-display-it-as-bitmap-in-actionscript.html
Generating a PNG file from bitmap data:
http://www.kaourantin.net/2005/10/png-encoder-in-as3.html
精彩评论