19Aug/082
Creating Easy Application Icons
Just a quick post mostly as a reminder to myself on how to easily create Icons for your Adobe AIR applications.
Once the application has finished Initializing i add a button to the main view. that calls a method called takeSnapShot( e : MouseEvent ); that writes the application out to the desktop as a PNG file.
private function takeSnapShot( e : MouseEvent ) : void { var bm : BitmapData = new BitmapData( Capabilities.screenResolutionX, Capabilities.screenResolutionY, true, 0x00FFFFFF ); bm.draw( view ); var ba : ByteArray; var pnge : PNGEncoder = new PNGEncoder( ); ba = pnge.encode( bm ); var file : File = File.desktopDirectory.resolvePath( "SnapShot.png" ); var filestream : FileStream = new FileStream( ); filestream.open( file, FileMode.WRITE ); filestream.writeBytes(ba); filestream.close(); }
Tagged as: Adobe AIR, ByteArray, File, FileStream, Icon files, Icons, PNGEncoder
Leave a comment
@Omnipitence
Applications
Recommended Reading
Blog Roll
Pages
Archives
- December 2011
- November 2011
- October 2011
- August 2011
- April 2011
- March 2011
- February 2011
- December 2010
- November 2010
- July 2010
- June 2010
- May 2010
- April 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- April 2009
- March 2009
- January 2009
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008





August 22nd, 2008 - 15:14
Interesting, but what is “view” in bm.draw( view ); ?
August 22nd, 2008 - 20:06
Ahh sorry,
Forgot to explain what that was.. I am currrently using a lot of pureMVC concepts and view is actually just a getter for the viewComponent in an application in this case the main stage..