On Sep 29, 2007, at 12:53 AM, mailtoanzer wrote:
Hi,
I want to do some image manipulations like crop, resize, blur etc in
my current Flex project. Can some one please point me to some open
source project or tutorials for this.

Thanks and Best Regards,
Anz


All of this is just actionscript programming with BitmapData objects (aside from UI controls). It depends on how complex you want to get. You would be much better off searching for specific tutorials for manipulation of bitmap images with BitmapData.

A few thoughts to get you started:

Crop : Use "copyPixels" and create a new BitmapData object from an existing one, passing in a custom rectangle for the crop area.

Resize : Depends on what you want to do here. If you want a user- definable resize, you need to implement some type of resize controller, say Senocular's Transform Tool - available for Flex through sephiroth.it. Premier Express (maybe), Fauxto (definitely), and even FotoFlexer (maybe) use this library.

If you just want to resize the bitmap, create a custom matrix and scale it by some amount and then use the "draw" method, passing in the bitmap to modify and the matrix to scale it by. Look up BitmapData for more details on the draw method.

Blur : Again, depends on what you want. You can use an actual blur filter or use a custom convolution filter, which can be used to blur, edge detect, or perform any other generalized operation. Some operations may need to be done on a pixel-by-pixel basis, so convolution filters do not help in this case.

As far as implementing them in Flex it's pretty much a UI issue at that point. You can get as simple as using a Sprite that holds a Bitmap (which is the visual rep. of a BitmapData class object) and apply all these effects to it to creating a custom UIComponent that allows resize, etc.

good luck with it,

jon

Reply via email to