|
|
@@ -0,0 +1,45 @@
|
|
|
+namespace Perspex.Direct2D1.RenderTests.Media
|
|
|
+{
|
|
|
+ using Perspex.Controls;
|
|
|
+ using Perspex.Media;
|
|
|
+ using System;
|
|
|
+ using System.Collections.Generic;
|
|
|
+ using System.Linq;
|
|
|
+ using System.Text;
|
|
|
+ using System.Threading.Tasks;
|
|
|
+ using Xunit;
|
|
|
+
|
|
|
+ public class LinearGradientBrushTests : TestBase
|
|
|
+ {
|
|
|
+ public LinearGradientBrushTests() : base(@"Media\LinearGradientBrush")
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ [Fact]
|
|
|
+ public void LinearGradientBrush_RedBlue_Fill()
|
|
|
+ {
|
|
|
+ Decorator target = new Decorator
|
|
|
+ {
|
|
|
+ Padding = new Thickness(8),
|
|
|
+ Width = 200,
|
|
|
+ Height = 200,
|
|
|
+ Child = new Border
|
|
|
+ {
|
|
|
+ Background = new LinearGradientBrush
|
|
|
+ {
|
|
|
+ StartPoint = new Point(0, 0.5),
|
|
|
+ EndPoint = new Point(1, 0.5),
|
|
|
+ GradientStops =
|
|
|
+ {
|
|
|
+ new GradientStop { Color = Colors.Red, Offset = 0 },
|
|
|
+ new GradientStop { Color = Colors.Blue, Offset = 1 }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ this.RenderToFile(target);
|
|
|
+ this.CompareImages();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|