This AIR Native Extension uses .NET to transcode BitmapData
objects into .bmp, .jpg, and .png formats much faster than existing ActionScript or Alchemy methods.
Contents:
FREImageProcessor
- A Visual C++ 2010 Express project which contains the native code.ImageProcessor
- A Flash Builder Library project for exposing an API to the native code in ActionScript.ImageProcessorTest
- A sample Flash Builder project which uses the extension to encode an image.- Batch files, so you don't have to use the command line.
- All intermediate files, so you don't have to compile everything yourself.
Requirements:
- Visual C++ 2010 Express
- AIR 3 SDK from Adobe Labs
- Flash Builder 4
The project contains some placeholder files that I cannot include in the repository because they are copyrighted by Adobe. After checking out the project, you need to:
- Replace
FREImageProcessor/FREImageProcessor/FlashRuntimeExtensions.h
withAIR_SDK/include/FlashRuntimeExtensions.h
- Replace
FREImageProcessor/FREImageProcessor/FlashRuntimeExtensions.lib
withAIR_SDK/lib/win/FlashRuntimeExtensions.lib
Now that everything is setup, you can try compiling everything yourself.
- Open
FREImageProcessor/FREImageProcessor.sln
in Visual C++ 2010 - Build the .dll (F7)
- Import
ImageProcessor
into Flash Builder - Build the .swc (Ctrl + B)
- Open the .swc with a .zip editor, and extract library.swf to the same folder as the .swc
- Build the .ane (run
ImageProcessor/bin/package.bat
) - Import
ImageProcessorTest
into Flash Builder - Build the .swf (Ctrl + B)
- Build the .exe (run
ImageProcessorTest/bin-debug/package.bat
) - If everything was successful, you can run the .exe and click the stage to encode a JPEG. It will be saved to
C:\temp.jpg
.