Easy ColorPicker for everything at stage
Flash, Flex Май 24th, 2007How to get color for any pixel at stage, including Sprites, video, Bitmaps etc...
Easy. Just 6 lines of code.
var pickerBMP:BitmapData = new BitmapData(1,1,false,0x0);
stage.addEventListener(MouseEvent.MOUSE_MOVE,checkColor);
function checkColor(e:Event) {
pickerBMP.setPixel(0,0,0xFFFFFF); // enter background color of your SWF
pickerBMP.draw(stage,new Matrix(1,0,0,1,-mouseX,-mouseY));
trace (pickerBMP.getPixel(0,0));
}
Хотите быть в курсе последних обновлений сайта? Подпишитесь на мой RSS.
I am Multitouch and Augmented Reality developer from Moscow, RUSSIA. 13 years expierence in Flash, 7 years in Lingo, 5 years in Processing and lots more!









Май 26th, 2007 at 19:39
[...] ps:此代码是基于Den (No click)的6行代码,我将用swf的形式实现出来,没办法要增加一行代码. 源文件下载 Add to del.icio.us [...]
Май 28th, 2007 at 11:07
[...] от Дена
(Нет голосов) Loading … Добавить новость на News2 [...]
Июнь 15th, 2008 at 19:00
it’s AS3?
can i use this funtion in AS2?
what can i do in AS3 to pickup the color ?
Ноябрь 4th, 2008 at 07:05
[...] http://www.cleoag.ru/2007/05/24/easy-colorpicker-for-everything-at-stage/ [...]