在as3中,我尝试使用阈值来查找具有特定值的像素。 BitmapData是透明的,我使用ARGB来给像素颜色。但是,当操作符为" =="时,阈值仅适用于alpha通道设置为ff的像素。有谁知道为什么?感谢
var bd:BitmapData = new BitmapData(5,5,true,0);
bd.setPixel32(1,1,0xffaaaaaa);
bd.setPixel32(2,2,0xffffffff);
bd.setPixel32(3,3,0xff5522aa);
bd.setPixel32(4,4,0xfa5522aa);
bd.setPixel32(0,0,0x005555ff);
var p:Point = new Point();
trace(bd.threshold(bd,bd.rect, p,"==",0xffaaaaaa)); // 1
trace(bd.threshold(bd,bd.rect, p,"==",0xffffffff)); // 1
trace(bd.threshold(bd,bd.rect, p,"==",0xff5522aa)); // 1
trace(bd.threshold(bd,bd.rect, p,"==",0xfa5522aa)); // 0
trace(bd.threshold(bd,bd.rect, p,"==",0x005555ff)); // 0