您现在的位置是:主页 > news > 私人设计网站推荐/石家庄新闻

私人设计网站推荐/石家庄新闻

admin2025/5/2 5:42:24news

简介私人设计网站推荐,石家庄新闻,做网站怎么样引流,wordpress登入界面版权声明:转载时请务必保留以下作者信息和链接 作者:陈维(chenweionlinehotmail.com)作者的网站:http://www.chenwei.mobi /** * 取得图像上指定位置像素的 rgb 颜色分量。 * param image 源图像。 * p…

私人设计网站推荐,石家庄新闻,做网站怎么样引流,wordpress登入界面版权声明:转载时请务必保留以下作者信息和链接 作者:陈维(chenweionlinehotmail.com)作者的网站:http://www.chenwei.mobi /** * 取得图像上指定位置像素的 rgb 颜色分量。 * param image 源图像。 * p…

版权声明:转载时请务必保留以下作者信息和链接
作者:陈维(chenweionline@hotmail.com)作者的网站:http://www.chenwei.mobi

 

    /**
     * 取得图像上指定位置像素的 rgb 颜色分量。
     * 
@param image 源图像。
     * 
@param x 图像上指定像素位置的 x 坐标。
     * 
@param y 图像上指定像素位置的 y 坐标。
     * 
@return 返回包含 rgb 颜色分量值的数组。元素 index 由小到大分别对应 r,g,b。
     
*/

    
public static int[] getRGB(BufferedImage image, int x, int y){
        
int[] rgb = new int [3];
        
int pixel = image.getRGB(x, y);
        rgb[
0= (pixel & 0xff0000>> 16;
        rgb[
1= (pixel & 0xff00>> 8;
        rgb[
2= (pixel & 0xff);
        
        
return  rgb;
    }