[心得] Flash色彩特效API簡易範例
如果你還沒有下載ColorTransformationMatrix這個API
請見3071篇的連結
那CTM的簡易範例開始囉~
(以下套用特效的MC都叫做target_mc)
P.S.上一篇忘記提到這個API的單位矩陣,也就是讓一切恢復正常的矩陣
→ColorTransformationMatrix.IDENTITY
1.讓target_mc的對比提升,亮度上升
import flash.filters.*;
import tw.edu.ntu.ee.cjcat.matrices.*;
var temp:Array = new Array();
temp.push(new ColorMatrixFilter(
ColorTransformationMatrix.contrast(0.5)));
temp.push(new ColorMatrixFilter(
ColorTransformationMatrix.brightness(0.7)));
target_mc.filters = temp;
2.讓target_mc變成黑白
import flash.filters.*;
import tw.edu.ntu.ee.cjcat.matrices.*;
var temp:Array = new Array();
temp.push(new ColorMatrixFilter(
ColorTransformationMatrix.GRAYSCALE));
target_mc.filters = temp;
3.讓target_mc產生反相效果
import flash.filters.*;
import tw.edu.ntu.ee.cjcat.matrices.*;
var temp:Array = new Array();
temp.push(new ColorMatrixFilter(
ColorTransformationMatrix.DIGITAL_NEGATIVE));
target_mc.filters = temp;
大致上就是這樣囉~其他功能就讓各位自行去摸索吧 :)
以上
--
CJ Cat = Croa'J Cat = Cockroach Cat = 西街凱特 = 蜚蠊貓 = 蟑螂貓
Gallery http://cjcat2266.deviantart.com
MSN cjcat2266@hotmail.com
Yahoo cjcat2266@yahoo.com.tw
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.228.74.179
推
08/08 15:30, , 1F
08/08 15:30, 1F
※ 編輯: cjcat2266 來自: 61.228.74.179 (08/08 17:09)