| Pacote | spark.filters |
| Classe | public class ColorMatrixFilter |
| Herança | ColorMatrixFilter BaseFilter EventDispatcher Object |
| Implementações | IBitmapFilter |
| Versão da linguagem: | ActionScript 3.0 |
| Versão de produto: | Flex 4 |
| Versões de runtime: | Flash Player 10, AIR 1.5 |
Ocultar sintaxe MXMLThe <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]"
/>
Mais exemplos
Elementos da API relacionados
Propriedades públicas
| Propriedade | Definido por | ||
|---|---|---|---|
![]() | constructor : Object
Uma referência ao objeto de classe ou à função de construtor de uma determinada ocorrência de objeto. | Object | |
| matrix : Object
A comma delimited list of 20 doubles that comprise a 4x5 matrix applied to the
rendered element. | ColorMatrixFilter | ||
Métodos públicos
| Método | Definido por | ||
|---|---|---|---|
ColorMatrixFilter(matrix:Array = null)
Constructor. | ColorMatrixFilter | ||
![]() | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registra um objeto de ouvinte de evento em um objeto EventDispatcher, de forma que o ouvinte receba a notificação de um evento. | EventDispatcher | |
Returns a copy of this filter object. | ColorMatrixFilter | ||
![]() |
Envia um evento para o fluxo de eventos. | EventDispatcher | |
![]() |
Verifica se o objeto EventDispatcher tem ouvintes registrados para um tipo específico de evento. | EventDispatcher | |
![]() |
Indica se um objeto tem uma propriedade especificada definida. | Object | |
![]() |
Indica se uma ocorrência da classe Object está na cadeia de protótipos do objeto especificado como o parâmetro. | Object | |
![]() |
Propagates a change event when the filter has changed. | BaseFilter | |
![]() |
Indica se a propriedade especificada existe e é enumerável. | Object | |
![]() |
Remove um ouvinte do objeto EventDispatcher. | EventDispatcher | |
![]() |
Define a disponibilidade de uma propriedade dinâmica para operações de repetição. | Object | |
![]() |
Retorna a representação da string deste objeto, formatado segundo as convenções específicas para a localidade. | Object | |
![]() |
Retorna a representação de string do objeto especificado. | Object | |
![]() |
Retorna o valor primitivo do objeto especificado. | Object | |
![]() |
Verifica se um ouvinte de evento está registrado nesse objeto EventDispatcher ou em qualquer um de seus ancestrais para o tipo de evento especificado. | EventDispatcher | |
Eventos
Constantes públicas
Detalhes da propriedade
matrix | propriedade |
matrix:Object| Versão da linguagem: | ActionScript 3.0 |
| Versão de produto: | Flex 4 |
| Versões de 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.
O valor padrão é [1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0].
Implementação
public function get matrix():Object public function set matrix(value:Object):voidDetalhes do construtor
ColorMatrixFilter | () | Construtor |
Detalhes do método
clone | () | método |
public function clone():BitmapFilter| Versão da linguagem: | ActionScript 3.0 |
| Versão de produto: | Flex 4 |
| Versões de runtime: | Flash Player 10, AIR 1.5 |
Returns a copy of this filter object.
RetornaBitmapFilter — A new ColorMatrixFilter instance with all of the same
properties as the original one.
|
Exemplos Como usar este exemplo
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>
Wed Jun 13 2018, 11:10 AM Z
Mostrar sintaxe MXML