| Pakiet | spark.filters |
| Klasa | public class ColorMatrixFilter |
| Dziedziczenie | ColorMatrixFilter BaseFilter EventDispatcher Object |
| Implementuje | IBitmapFilter |
| Wersja języka: | ActionScript 3.0 |
| Wersja produktu: | Flex 4 |
| Wersje środowiska wykonawczego: | Flash Player 10, AIR 1.5 |
Ukryj składnię 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]"
/>
Powiązane elementy interfejsu API
Właściwości publiczne
| Właściwość | Zdefiniowane przez | ||
|---|---|---|---|
![]() | constructor : Object
Odwołanie do obiektu klasy lub funkcji konstruktora, dotyczące danej instancji obiektu. | Object | |
| matrix : Object
A comma delimited list of 20 doubles that comprise a 4x5 matrix applied to the
rendered element. | ColorMatrixFilter | ||
Metody publiczne
| Metoda | Zdefiniowane przez | ||
|---|---|---|---|
ColorMatrixFilter(matrix:Array = null)
Constructor. | ColorMatrixFilter | ||
![]() | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Rejestruje obiekt detektora zdarzeń w obiekcie EventDispatcher, dzięki czemu detektor będzie otrzymywał powiadomienia o zdarzeniu. | EventDispatcher | |
Returns a copy of this filter object. | ColorMatrixFilter | ||
![]() |
Wywołuje zdarzenie, tj. kieruje je do przepływu zdarzeń. | EventDispatcher | |
![]() |
Sprawdza, czy obiekt EventDispatcher zawiera jakiekolwiek detektory zarejestrowane dla konkretnego typu zdarzeń. | EventDispatcher | |
![]() |
Wskazuje, czy dla obiektu zdefiniowano określoną właściwość. | Object | |
![]() |
Wskazuje, czy instancja klasy Object należy do łańcucha prototypów obiektu określonego jako parametr. | Object | |
![]() |
Propagates a change event when the filter has changed. | BaseFilter | |
![]() |
Wskazuje, czy określona właściwość istnieje i jest przeliczalna. | Object | |
![]() |
Usuwa detektor z obiektu EventDispatcher. | EventDispatcher | |
![]() |
Ustawia dostępność właściwości dynamicznej używanej w pętlach. | Object | |
![]() |
Zwraca ciąg reprezentujący obiekt — sformatowany zgodnie z konwencjami właściwymi dla ustawień regionalnych. | Object | |
![]() |
Zwraca ciąg reprezentujący określony obiekt. | Object | |
![]() |
Zwraca pierwotną wartość dla określonego obiektu. | Object | |
![]() |
Sprawdza, czy detektor zdarzeń określonego typu jest zarejestrowany w tym obiekcie EventDispatcher lub jego elementach macierzystych. | EventDispatcher | |
Zdarzenia
Stałe publiczne
Szczegół właściwości
matrix | właściwość |
matrix:Object| Wersja języka: | ActionScript 3.0 |
| Wersja produktu: | Flex 4 |
| Wersje środowiska wykonawczego: | 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.
Wartością domyślną jest [1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0].
Implementacja
public function get matrix():Object public function set matrix(value:Object):voidKonstruktor Szczegół
ColorMatrixFilter | () | Konstruktor |
Szczegół metody
clone | () | metoda |
public function clone():BitmapFilter| Wersja języka: | ActionScript 3.0 |
| Wersja produktu: | Flex 4 |
| Wersje środowiska wykonawczego: | Flash Player 10, AIR 1.5 |
Returns a copy of this filter object.
ZwracaBitmapFilter — A new ColorMatrixFilter instance with all of the same
properties as the original one.
|
Przykłady Sposób korzystania z tego przykładu
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, 12:06 PM Z
Pokaż składnię MXML