3

这是我需要的图像:

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);
4

1 回答 1

4

想通了,

//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);

其中颜色位置是上面颜色的百分比位置(可以有很多你想要的)

于 2012-08-02T20:44:10.800 回答