2012-04-30 36 views
0

我在我的控制WPF圖像淡入淡出C#

public List<BitmapImage> Images { get; set; } 

圖像列表我用一個定時器來改變圖像。

 Image imgpanel = new System.Windows.Controls.Image(); 
     imgpanel.Source = image; 
     imgpanel.Stretch = maintainAspectRatio ? Stretch.Uniform : Stretch.Fill; 
     imgpanel.StretchDirection = StretchDirection.Both; 

有誰知道一種方法,使他們交換時,他們看起來更好,我可以交叉衰減的圖像?

回答

0

您可以在佈局中使用兩個重疊的Image控件,並使用故事板將它們淡入/淡出。然後,您可以將圖像加載到隱藏的Image控件中,並在完成時將其淡入,另一個淡出。這繼續和...

+0

我會調查謝謝:) http://wpf-samples.blogspot.co.uk/2007/01/programmatic-fade-in-out-sample.html –