开发者

Any algorithm to check every pixels that contain specific color?. in Android :)

开发者 https://www.devze.com 2023-03-22 16:54 出处:网络
Now I have 2 dimension array that collects all color\'s pixel and I have 1 dimension array that collects a specific color that every pixel need to check with this array. But how to check this 2 array

Now I have 2 dimension array that collects all color's pixel and I have 1 dimension array that collects a specific color that every pixel need to check with this array. But how to check this 2 arrays

first array is array_A = new String[bitmap.getWidth()][bitmap.getHeight()];

Another is final String[] array_B = { "ffcc33","ffcc00",....} so how can I check this 2 arrays :)) Thank开发者_如何学JAVAs in Advance


Hope that snippets would help you. Also, you can use pixel[] = new int [width*height] to get pixel from image.

for(int w= 0; w < bitmap.getwidth(); w++)
{
    for(int h = 0 ; h < bitmap,getheight() ; h++ )
    {
        int c = bitmap.getPixel(w, h);
        Log.i("Pixels", h+"X"+w);
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消