Applying effects to an image with Flex ConvolutionFilter
Post by efox | Date: 2009-03-10
Like the ColorMatrixFilter, the ConvolutionFilter also uses a matrix to change the image but in this case the matrix can be any size. There are a number of factors that affect performance and they are outlined in the Flex documentation. The most common matrix you will use is a 3x3 matrix. Applying effects is basically the same as applying color effects - you create a filter and add it to the filters array of the display object. Here is the example shows three effects: emboss, sharpen and edge detection.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
creationComplete="transformImage()" verticalScrollPolicy="off" horizontalScrollPolicy="off">
<mx:Script>
<![CDATA[
[Bindable]
[Embed(source="images/demo.jpg")]
private var demoImage:Class;
Click here to read this article...
Tags: Flex effects emboss sharpen edge detection
Adding drop shadow to an image with Flex DropShadowFilter
Post by efox | Date: 2009-02-04
DropShadowFilter is a useful and lovely filter. you can add a drop shadow to anything with this class simple and quickly, The example code of adding drop shadow to an image is the following:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
creationComplete="transformImage()" verticalScrollPolicy="off" horizontalScrollPolicy="off">
<mx:Script>
<![CDATA[
[Bindable]
[Embed(source="images/demo.jpg")]
private var demoImage:Class;
Adjusting brightness with Flex ColorMatrixFilter class
Post by efox | Date: 2008-12-28
The ColorMatrixFilter class lets you apply a 4 x 5 matrix transformation on the RGBA color and alpha values of every pixel in the input image to produce a result with a new set of RGBA color and alpha values. You can apply the filter to any display object (that is, objects that inherit from the DisplayObject class), such as MovieClip, SimpleButton, TextField, and Video objects, as well as to BitmapData objects. Here is the example to adjusting brightness of a picture.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
creationComplete="transformImage()" verticalScrollPolicy="off" horizontalScrollPolicy="off">
<mx:Script>
<![CDATA[
[Bindable]
[Embed(source="images/demo.jpg")]
private var demoImage:Class;
Click here to read this article...
Tags: Flex ColorMatrixFilter brightness
Create cool color transition button in Flex
Post by efox | Date: 2008-10-22
In this article I want to shows how to create color transition button by fading the background color of an element in Flex . In order to make the button more attractive, I added some effects like drop shadow, bevel and glow.
//colorAnimaton.as
package com.foxarc
{
import mx.effects.AnimateProperty;
import com.foxarc.instance.colorAnimationInstance;
import mx.effects.IEffectInstance;
Click here to read this article...
Tags: Flex color transition button







