Android–LinearGradient線性漸變

 

 

[html]  

Paint paint = new Paint();  

        LinearGradient gradient = new LinearGradient(0, 0, 100, 100, Color.RED, Color.YELLOW, Shader.TileMode.MIRROR);  

        paint.setShader(gradient);  

        canvas.drawRect(0, 0, 100, 100, paint);  

        canvas.drawText("This is the shader", 100, 100, paint);  

 

 

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *