2015-11-07 73 views
0

我在鼠標左鍵上創建線性漸變。這是 我想實現上述線性漸變刷c#在windows phone 8.0上的線性漸變畫筆

private void r10_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) 
     { 
      r10.Background = new LinearGradientBrush(Colors.Purple, Colors.Gray, 90); 
     } 

如果你有任何想法,請幫助

+0

這是一個可怕的方式來問一個問題。你沒有絲毫暗示什麼是問題。 W.B.我可能是對的。 – TaW

+0

whaat ??先生,真的嗎? –

+0

是的,真的。你還沒有問過問題! - 你有錯誤嗎?你期望從創建畫筆的屏幕動作?你有沒有閱讀過這個網站的最簡介頁面(或關於LinearGradientBrush)? – TaW

回答

0

你使用Silverlight中不存在構造函數的代碼。你可以這樣改寫你的代碼:

var gradients = new GradientStopCollection 
{ 
    new GradientStop {Color = Colors.Purple, Offset = 0}, 
    new GradientStop {Color = Colors.Gray, Offset = 1} 
}; 

r10.Background.Background = new LinearGradientBrush(gradients, 90);