2010-11-18 178 views
0

我有這樣的代碼:反方向線性漸變

LinearGradient backlg = new LinearGradient(0, 0, 10, 10, 
      new int[]{Color.BLACK, Color.BLACK, Color.BLUE, Color.BLUE}, 
      new float[]{0,0.5f,.55f,1}, Shader.TileMode.REPEAT); 

它創建斜帶藍色和黑色之間交替。他們從左下角到右上角,所以這是我的問題,我應該怎樣改變才能從左上角到右下角?

回答

1

難道這就是你的意思是:

LinearGradient backlg = new LinearGradient(0, 10, 10, 0, 
     new int[]{Color.BLACK, Color.BLACK, Color.BLUE, Color.BLUE}, 
     new float[]{0,0.5f,.55f,1}, Shader.TileMode.REPEAT);