这是我需要的图片:
http://imgur.com/prXA5 我需要从 1 到 2,它必须是一个没有 xml 的程序。
//Create transparent circle
RadialGradient gradient = new android.graphics.RadialGradient(newBitmap.getWidth() / 2,newBitmap.getHeight() / 2, newBitmap.getWidth() - newBitmap.getWidth() / 2, 0x00000000, 0xFF000000, android.graphics.Shader.TileMode.CLAMP);
最佳答案
想通了,
//Create transparent circle
int[] Colors = {0x00000000, 0xFF000000};
float[] ColorPosition = {0.60f, 0.99f};
RadialGradient gradient = new android.graphics.RadialGradient(newBitmap.getWidth() / 2,newBitmap.getHeight() / 2, newBitmap.getWidth() - newBitmap.getWidth() /2, Colors, ColorPosition, android.graphics.Shader.TileMode.CLAMP);
其中颜色位置是上面颜色的百分比位置(可以有很多)
关于java - 改变 RadialGradient,渐变位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11783140/