Contact envelope



Functions used to apply effects to bitmap data.

Creating and Using the Functions

The BitmapAdjustments class is purely static and all functions work by returning the modified bitmap data. They do not function like flash filters and are not applied dynamically. Developers must manually apply the modified bitmap data.

See the ASDocs for the specifics of what adjustments are available.

Performance Implications

Some of the effects, especially the oil painting and kuwahara effect, can be extremely performance intensive. Huge images will simply cause the player to timeout. Therefore, either resize images to smaller dimensions before applying the effect, and then blow the bitmap data back up, or process large images line by line.

Sample Usage

<s:Image id="img"
	 source="@Embed(source='sun.jpg')" />
<s:Button label="Pixelate"
	  click="img.source = BitmapAdjustments.pixelate(img.bitmapData, 0, -1, 
		PixelateTypes.RECTANGLE, 10, 0, 0, 0);" />

In the example above, clicking the button would convert the image to a pixelated version.


See the BitmapAdjustments demo application for additional example code.

Back To Top