开发者

SurfaceScrollView: fade out not visible content

Is it somehow possible to fade out the content that is not visible in the SurfaceScrollViewer?

As mentioned in the answer I tried this, but c开发者_StackOverflow中文版ouldn't recognize any fading:

//fading out
                Rectangle fade = new Rectangle();
                fade.Width = 478;
                fade.Height = 140;
                fade.IsHitTestVisible = false;
                LinearGradientBrush myBrush = new LinearGradientBrush();
                myBrush.GradientStops.Add(new GradientStop(Color.FromArgb(50, 50,50,50), 0.0));
                myBrush.GradientStops.Add(new GradientStop(Colors.Transparent, 0.5));
                myBrush.GradientStops.Add(new GradientStop(Color.FromArgb(50, 50, 50, 50), 1.0));
                fade.Fill = myBrush;


I finally solved it that way:

GradientStopCollection collection = new GradientStopCollection();
collection.Add(new GradientStop(Colors.Transparent, 0));
collection.Add(new GradientStop(Colors.Black, 0.1));
collection.Add(new GradientStop(Colors.Black, 0.9));
collection.Add(new GradientStop(Colors.Transparent, 1));
LinearGradientBrush brush = new LinearGradientBrush(collection);

scroller.OpacityMask = brush;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜