LinearGradient 1234 float[] positions = {0.0f, 0.5f, 1.0f};int[] colors = {Color.RED, Color.GREEN, Color.MAGENTA};Shader.TileMode tileMode = Shader.TileMode.MIRROR;Shader linearGradient = new LinearGradient(x0, y0, x1, y1, colors, positions, tileMode); RadialGradient 1234 float[] positions = {0.0f, 0.5f, 1.0f};int[] colors = {Color.RED, Color.GREEN, Color.MAGENTA};Shader.TileMode tileMode = Shader.TileMode.MIRROR;Shader radialGradient = new RadialGradient(centerX, centerY, radius, colors, positions, tileMode); SweepGradient 123 float[] positions = {0.0f, 0.5f, 1.0f};int[] colors = {Color.RED, Color.GREEN, Color.MAGENTA};Shader sweepGradient = new SweepGradient(centerX, centerY, colors, positions); BitmapShader 1 BitmapShader bitmapShader = new BitmapShader(bitmap, tileX, tileY); ComposeShader 1 ComposeShader composeShader = new ComposeShader(linearGradient, bitmapShader, PorterDuff.Mode.ADD); 赞微海报分享
近期评论