Re: [問題] Flash中webcam問題
BitmapData.threshold()可以抓取特定顏色所在的範圍
不知道這是不是你想要的功能
可是他的抓取特定顏色是沒有"容忍值"的
要"容忍值"的話,應該還是需要用getPixel()之類method的自己去做判斷
BitmapData.threshold()的大致用法長這樣:
import flash.display.*;
import flash.geom.*;
var rect:Rectangle = bitmap.getBounds(bitmap);
var origin:Point = new Point(0, 0);
var testColor:uint = 0xFF6083a3; //用AS2就把uint改成Number
var targetColor:uint = 0xFFCC0000;
pic.threshold(pic, rect, origin, "==", color, targetColor);
這樣可以抓取顏色為testColor的像素,把其顏色改為targetColor
BitmapData.threshold()也可以將一個空白的BitmapData
在另外一個BitmapData的testColor所在像素對應的位置
給填上指定的targetColor
--
CJ Cat = Croa'J Cat = Cockroach Cat = 西街凱特 = 蜚蠊貓 = 蟑螂貓
Gallery http://cjcat2266.deviantart.com
ptt2 Board CJWorkshop - 阿多比閃光(Adobe Flash)研討區
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.228.75.107
→
03/07 02:17, , 1F
03/07 02:17, 1F
→
03/07 02:17, , 2F
03/07 02:17, 2F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 4 之 6 篇):
Flash 近期熱門文章
PTT數位生活區 即時熱門文章