开发者

Is there a way to get some realistic photo filters in Flash with AS3?

开发者 https://www.devze.com 2023-03-01 05:17 出处:网络
Does anyone know or can point me in the right direction on how to reproduce the Photoshop Image/Adjustments/Photo filters... in Flash 开发者_开发知识库with AS3. Is the same result that you get when yo

Does anyone know or can point me in the right direction on how to reproduce the Photoshop Image/Adjustments/Photo filters... in Flash 开发者_开发知识库with AS3. Is the same result that you get when you put a filter over the lenses of a camera. I exclude using tint and hue from the start because it doesn't help me at all, I think could get this from code by using color matrix class or convolution filter, any ideas??


ColorMatrixFilter is definitely your best bet.. Here's a quick example on making a DisplayObject black & white.

var bnw:Array = [1.2,0,0,0,0,1.2,0,0,0,0,1.2,0,0,0,0,0,0,0,1,0];
var filter:ColorMatrixFilter = new ColorMatrixFilter(bnw);

yourDisplayObject.filters = [filter];

The actual values confuse the heck out of me, I just play around. It mostly makes sense.. This will give you a little more info:

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/filters/ColorMatrixFilter.html

0

精彩评论

暂无评论...
验证码 换一张
取 消