WEB开发网      濠电娀娼ч崐濠氬疾椤愶附鍋熸い鏍ㄧ〒闂勫嫰鏌﹀Ο渚Ц闁诲氦顕ч湁婵犲﹤楠告禍鍓х磼鏉堛劌绗氶柟宄版嚇閹晠宕归銈嗘濠电偞鍨堕幐鎾磻閹捐秮褰掓偐閻戞﹩妫勯梺鎼炲妼鐎涒晝绮嬪澶樻晝闁挎繂鏌婇敃鍌涚厵閻庢稒锚閻忥絾绻濇繝鍐ㄧ伌闁诡垰鍟村畷鐔碱敂閸♀晙绱樺┑鐐差嚟婵儳螞閸曨剚鍙忛柍鍝勬噹缁€澶嬬箾閹存繄锛嶆鐐灲閹綊宕惰濡插鏌涢妸銉ヮ劉缂佸倸绉归弫鎾绘晸閿燂拷 ---闂備焦瀵уú鈺呭箯閿燂拷
开发学院图形图像Flash Understanding AS3 ColorMatrixFilter class 阅读

Understanding AS3 ColorMatrixFilter class

 2009-10-27 00:00:00 来源:WEB开发网 闂備線娼уΛ鎾箯閿燂拷闂備礁鎲¢崹鐢垫崲閹扮増鍎嶆い鎺戝€甸崑鎾斥槈濞嗗秳娌紓鍌氱▌閹凤拷濠电姭鎷冮崨顓濈捕闂侀潧娲ゅú銊╁焵椤掍胶鈯曢柕鍥╁仧缁辩偤鏁撻敓锟�闂備線娼уΛ鎾箯閿燂拷  闂備胶枪缁绘鈻嶉弴銏犳瀬闁绘劕鎼痪褔鏌曟繝蹇曠窗闁煎壊浜滈—鍐偓锝庡墮娴犙勭箾閸喎鐏ユい鏇樺劦椤㈡瑩鎮℃惔銇帮拷
核心提示: we have no changes. Why not? because the matrix is an identity matrix.An identity matrix or unit matrix of size n is the n-by-n square matrix with o

we have no changes. Why not? because the matrix is an identity matrix.

An identity matrix or unit matrix of size n is the n-by-n square matrix with ones on the main diagonal and zeros elsewhere.

Changing the saturation

To change the saturation of an image, simply boost red component on red channel, green component on green channel and blue component on blue channel, while decreasing the other ones.

 package {
 import flash.display.Sprite;
 import flash.filters.ColorMatrixFilter;
 public class cmf extends Sprite {
  var cats_image:cats=new cats();
  public function cmf() {
   addChild(cats_image);
   var matrix:Array = new Array();
   matrix=matrix.concat([2,-1,0,0,0]);// red
   matrix=matrix.concat([-1,2,0,0,0]);// green
   matrix=matrix.concat([0,-1,2,0,0]);// blue
   matrix=matrix.concat([0,0,0,1,0]);// alpha
   var my_filter:ColorMatrixFilter=new ColorMatrixFilter(matrix);
   cats_image.filters=[my_filter];
  }
 }
}

Understanding AS3 ColorMatrixFilter class

Adding contrast

To add contrast, increase red component on red channel, green component on green channel and blue component on blue channel and decrease all offset values, this way

上一页  1 2 3 4  下一页

Tags:Understanding AS ColorMatrixFilter

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接