var linkageId = "Bliss.jpg";
var myBitmapData = flash.display.BitmapData.loadBitmap(linkageId);
var mc = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());
var colorTrans = new flash.geom.ColorTransform();
var rect = createRectangle(100, 20, 0x000000);
var trans = new flash.geom.Transform(rect);
onEnterFrame = function () {
colorTrans.rgb = myBitmapData.getPixel(_xmouse, _ymouse);
trans.colorTransform = colorTrans;
};示例:
源文件:
[img]/uploads/allimg/080325/1850270.gif[/img]
[url=http://www2.flash8.net/UploadTeach/2006/02/09/200629111457981.rar]colorPick_Bliss.rar[/url]
本文转自:http://www.5uflash.com/flashjiaocheng/Flash-as3-jiaocheng/312.html
var myBitmapData = flash.display.BitmapData.loadBitmap(linkageId);
var mc = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());
var colorTrans = new flash.geom.ColorTransform();
var rect = createRectangle(100, 20, 0x000000);
var trans = new flash.geom.Transform(rect);
onEnterFrame = function () {
colorTrans.rgb = myBitmapData.getPixel(_xmouse, _ymouse);
trans.colorTransform = colorTrans;
};示例:
源文件:
[img]/uploads/allimg/080325/1850270.gif[/img]
[url=http://www2.flash8.net/UploadTeach/2006/02/09/200629111457981.rar]colorPick_Bliss.rar[/url]
本文转自:http://www.5uflash.com/flashjiaocheng/Flash-as3-jiaocheng/312.html