Pacchetto | spark.filters |
Classe | public class ColorMatrixFilter |
Ereditarietà | ColorMatrixFilter BaseFilter EventDispatcher Object |
Implementa | IBitmapFilter |
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 4 |
Versioni runtime: | Flash Player 10, AIR 1.5 |
The <s:ColorMatrixFilter>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:ColorMatrixFilter Properties matrix="[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]" />
Altri esempi
Elementi API correlati
Proprietà pubbliche
Proprietà | Definito da | ||
---|---|---|---|
constructor : Object
Un riferimento all'oggetto classe o alla funzione di costruzione per una determinata istanza di oggetto. | Object | ||
matrix : Object
A comma delimited list of 20 doubles that comprise a 4x5 matrix applied to the
rendered element. | ColorMatrixFilter |
Metodi pubblici
Metodo | Definito da | ||
---|---|---|---|
ColorMatrixFilter(matrix:Array = null)
Constructor. | ColorMatrixFilter | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registra un oggetto listener di eventi con un oggetto EventDispatcher, in modo che il listener riceva la notifica di un evento. | EventDispatcher | ||
Returns a copy of this filter object. | ColorMatrixFilter | ||
Invia un evento nel flusso di eventi. | EventDispatcher | ||
Verifica se per l'oggetto EventDispatcher sono presenti listener registrati per un tipo specifico di evento. | EventDispatcher | ||
Indica se per un oggetto è definita una proprietà specifica. | Object | ||
Indica se un'istanza della classe Object si trova nella catena di prototipi dell'oggetto specificato come parametro. | Object | ||
Propagates a change event when the filter has changed. | BaseFilter | ||
Indica se la proprietà specificata esiste ed è enumerabile. | Object | ||
Rimuove un listener dall'oggetto EventDispatcher. | EventDispatcher | ||
Imposta la disponibilità di una proprietà dinamica per le operazioni cicliche. | Object | ||
Restituisce la rappresentazione in formato stringa di questo oggetto, formattato in base alle convenzioni specifiche per le versioni localizzate. | Object | ||
Restituisce la rappresentazione in formato stringa dell'oggetto specificato. | Object | ||
Restituisce il valore di base dell'oggetto specificato. | Object | ||
Verifica se un listener di eventi è registrato con questo oggetto EventDispatcher o qualsiasi suo antenato per il tipo di evento specificato. | EventDispatcher |
Eventi
Costanti pubbliche
Descrizione delle proprietà
matrix | proprietà |
matrix:Object
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 4 |
Versioni runtime: | Flash Player 10, AIR 1.5 |
A comma delimited list of 20 doubles that comprise a 4x5 matrix applied to the rendered element. The matrix is in row major order -- that is, the first five elements are multipled by the vector [srcR,srcG,srcB,srcA,1] to determine the output red value, the second five determine the output green value, etc.
The value must either be an array or comma delimited string of 20 numbers.
Il valore predefinito è [1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0].
Implementazione
public function get matrix():Object
public function set matrix(value:Object):void
Descrizione della funzione di costruzione
ColorMatrixFilter | () | Funzione di costruzione |
Descrizione dei metodi
clone | () | metodo |
public function clone():BitmapFilter
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 4 |
Versioni runtime: | Flash Player 10, AIR 1.5 |
Returns a copy of this filter object.
RestituisceBitmapFilter — A new ColorMatrixFilter instance with all of the same
properties as the original one.
|
ColorMatrixFilterExample.mxml
<?xml version="1.0"?> <!-- filters/examples/ColorMatrixFilterExample .mxml --> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark" creationComplete="createFilters()"> <fx:Script><![CDATA[ import spark.filters.*; import flash.filters.BitmapFilterQuality; import flash.filters.BitmapFilterType; private var myGreenMatrixFilter:ColorMatrixFilter; private var myBlueMatrixFilter:ColorMatrixFilter; private var myRedMatrixFilter:ColorMatrixFilter; public function createFilters():void { var greenMatrix:Array = new Array(); greenMatrix = greenMatrix.concat([0, 0, 0, 0, 0]); // red greenMatrix = greenMatrix.concat([0, 1, 0, 0, 0]); // green greenMatrix = greenMatrix.concat([0, 0, 0, 0, 0]); // blue greenMatrix = greenMatrix.concat([0, 0, 0, 1, 0]); // alpha var blueMatrix:Array = new Array(); blueMatrix = blueMatrix.concat([0, 0, 0, 0, 0]); // red blueMatrix = blueMatrix.concat([0, 0, 0, 0, 0]); // green blueMatrix = blueMatrix.concat([0, 0, 1, 0, 0]); // blue blueMatrix = blueMatrix.concat([0, 0, 0, 1, 0]); // alpha var redMatrix:Array = new Array(); redMatrix = redMatrix.concat([1, 0, 0, 0, 0]); // red redMatrix = redMatrix.concat([0, 0, 0, 0, 0]); // green redMatrix = redMatrix.concat([0, 0, 0, 0, 0]); // blue redMatrix = redMatrix.concat([0, 0, 0, 1, 0]); // alpha myGreenMatrixFilter = new ColorMatrixFilter(greenMatrix); myBlueMatrixFilter = new ColorMatrixFilter(blueMatrix); myRedMatrixFilter = new ColorMatrixFilter(redMatrix); greenImage.filters = [myGreenMatrixFilter]; blueImage.filters = [myBlueMatrixFilter]; redImage.filters = [myRedMatrixFilter]; } ]]></fx:Script> <s:VGroup> <s:VGroup> <s:Label text="Original Image"/> <mx:Image id="originalImage" source="@Embed(source='assets/Nokia_6630.png')"/> </s:VGroup> <s:VGroup> <s:Label text="Green Matrix Image"/> <mx:Image id="greenImage" source="@Embed(source='assets/Nokia_6630.png')"/> </s:VGroup> <s:VGroup> <s:Label text="Blue Matrix Image"/> <mx:Image id="blueImage" source="@Embed(source='assets/Nokia_6630.png')"/> </s:VGroup> <s:VGroup> <s:Label text="Red Matrix Image"/> <mx:Image id="redImage" source="@Embed(source='assets/Nokia_6630.png')"/> </s:VGroup> </s:VGroup> </s:Application>
Tue Jun 12 2018, 02:44 PM Z