Here’s a little utility that allows you to batch-resize or crop images and output as JPG — along with the source code. If you’re not familiar with AIR, you just need to download AIR first before you download & install the Image Resizer:
Also a few notes that might be of interest to developers:
For developers working in Eclipse/Flex: there is an ANT build file in the root directory of the .zip. Be sure to update “build.properties” with the location of your Flex SDK and project directory. Also, be sure to add “lib.swc” to your classpath.
For developers working in Flash: You can publish “build.fla”, but be sure to add “com.Main” as your document root.
If you’re trying to resize a display object’s bitmap for output, you can use the Matrix class. Let’s say we want to resize “target_mc” to 50% of it’s width and height:
If you want to save an image as a JPG or PNG from Flash, you” first need to grab corelib from Google Code.
You can pass an image’s bitmapData to the encoder and then write the file using FileStream. For example, we want to save “target_bmd” BitmapData as a JPEG named “output.jpg” in the user’s “Documents” folder: