0
void changeColor(int a, int r, int g, int b){
String hex = + Integer.toHexString(a) + Integer.toHexString(r) +
Integer.toHexString(g) + Integer.toHexString(b);
int color = hex //Obviously this is a type mismatch, but how do I do this?
mpaint.setColor(color);
}
显然这是一种类型不匹配,但我该怎么做?将字符串转换为十六进制以用作画布颜色Java
的可能重复[转换成十六进制的字符串表示的字节数组使用Java?](http://stackoverflow.com/questions/140131/convert-a-string-representation-of-a-hex-dump-to-a-byte-array-using-java) – Bozho 2012-01-03 22:54:29