码迷,mamicode.com
首页 > 其他好文 > 详细

Shader的使用

时间:2016-05-18 12:32:11      阅读:109      评论:0      收藏:0      [点我收藏+]

标签:

一、LinearGradient

步骤:①、创建LinearGradient  步骤   ②、将其加入到Paint

步骤一:

构造LinearGradient的参数

public LinearGradient (float x0, float y0, float x1, float y1, int[] colors, float[] positions, Shader.TileMode tile);

x0,y0代表渐变的起始位置,x1,y1代表终止位置。

两边位置决定是纵向渐变还是横向,或者倾斜。

例:x0 = 0, y0= 0,x1=0,y1 = height  为垂直渐变。(其他的就不举例了)

http://www.tuicool.com/articles/RF7v2qY

Shader的使用

标签:

原文地址:http://www.cnblogs.com/rookiechen/p/5504447.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!