开发者

Getting Icons for File Extensions in Adobe Air

I'm working on an Adobe Air Desktop App ATM.

My question is how to get the icon for a given file extension, but without actually loading up a file of such type.

I had the idea to just create a blank file for the extension and then delete it once i have the bitmap for its icon, but that seemed like too much trouble and kinda inefficient.

So for example i want to get the开发者_如何学Go icon associated with a .txt file, or .html file. Is their any way of doing such without having to directly reference and existing file , or create a temporary one as mentioned above?


Just in case you didn't find this solution by yourself, please have a look at the File class.

It has an "icon" property which may well be just what you're looking for.

Good luck.


I ended up just having to do as i though, just create a temporary file on the desktop with the given file extension, open and close a stream to it ( no need to write anything to it ), then i could access its icon. After which i deleted the file, and all was good.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜