getcolor

    0热度

    1回答

    我试图获取像素的颜色。我在我的OnCreate如下: bitmap = img.getDrawingCache(); int pixel = bitmap.getPixel(5,5); int r = Color.red(pixel); int g = Color.green(pixel); int b = Color.blue(pixel); Toast.makeText(getA

    0热度

    1回答

    LinearLayout linearLayout = (LinearLayout) findViewById(R.id.linear); int color = ContextCompat.getColor(getContext(), mColorResourceId); linearLayout.setBackgroundColor(color); 我有这行代码: mColorReso