Actionscript 3 如何在actionscript3上使颜色透明

Actionscript 3 如何在actionscript3上使颜色透明,actionscript-3,png,transparency,Actionscript 3,Png,Transparency,我有一个png,主要有两种颜色作为背景。我想知道as3是否提供了选择颜色以使其透明的方法。看看BitmapData类 您可以选择每个像素的颜色和部分像素的透明度。一个选项是使用BitmapData方法阈值: public function threshold(sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, operation:String, threshold:uint, color:uint = 0, m

我有一个png,主要有两种颜色作为背景。我想知道as3是否提供了选择颜色以使其透明的方法。

看看BitmapData类


您可以选择每个像素的颜色和部分像素的透明度。

一个选项是使用BitmapData方法阈值:

public function threshold(sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, operation:String, threshold:uint, color:uint = 0, mask:uint = 0xFFFFFFFF, copySource:Boolean = false):uint