diff options
author | unknown-user <unknown-user@127.0.0.1> | 2013-04-26 15:30:42 +0400 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@MacBook-Air-de-Lluis.local> | 2013-04-26 21:39:20 +0400 |
commit | 537d273371223d1991eaec28c5fd982e24329c77 (patch) | |
tree | 12aee578f9c9d123e343a76135ab39f14b6fdfb9 /Testing/Tests | |
parent | a7475aac4fe9481454e61604a0b52b4c409b3f56 (diff) |
Add tests for image pattern with alpha
Diffstat (limited to 'Testing/Tests')
-rw-r--r-- | Testing/Tests/DrawingTests.cs | 48 | ||||
-rw-r--r-- | Testing/Tests/ReferenceImages/ImagePatternWithAlpha.png | bin | 0 -> 293 bytes | |||
-rw-r--r-- | Testing/Tests/ReferenceImages/ImagePatternWithRotateTransformWithAlpha.png | bin | 0 -> 1595 bytes | |||
-rw-r--r-- | Testing/Tests/ReferenceImages/ImagePatternWithScaleTransformWithAlpha.png | bin | 0 -> 394 bytes | |||
-rw-r--r-- | Testing/Tests/ReferenceImages/ImagePatternWithTranslateTransformWithAlpha.png | bin | 0 -> 283 bytes | |||
-rw-r--r-- | Testing/Tests/Tests.csproj | 12 |
6 files changed, 60 insertions, 0 deletions
diff --git a/Testing/Tests/DrawingTests.cs b/Testing/Tests/DrawingTests.cs index 5f667695..f4f59027 100644 --- a/Testing/Tests/DrawingTests.cs +++ b/Testing/Tests/DrawingTests.cs @@ -418,6 +418,54 @@ namespace Xwt context.Fill (); CheckImage ("ImagePatternWithScaleTransform.png"); } + + [Test] + public void ImagePatternWithAlpha () + { + InitBlank (70, 70); + context.Rectangle (5, 5, 40, 60); + var img = Image.FromResource (GetType(), "pattern-sample.png"); + img = img.WithAlpha (0.5); + context.Pattern = new Xwt.Drawing.ImagePattern (img); + context.Fill (); + CheckImage ("ImagePatternWithAlpha.png"); + } + + [Test] + public void ImagePatternWithTranslateTransformWithAlpha () + { + InitBlank (70, 70); + context.Translate (5, 5); + context.Rectangle (0, 0, 40, 60); + var img = Image.FromResource (GetType(), "pattern-sample.png"); + context.Pattern = new Xwt.Drawing.ImagePattern (img.WithAlpha (0.5)); + context.Fill (); + CheckImage ("ImagePatternWithTranslateTransformWithAlpha.png"); + } + + [Test] + public void ImagePatternWithRotateTransformWithAlpha () + { + InitBlank (70, 70); + context.Rotate (4); + context.Rectangle (5, 5, 40, 60); + var img = Image.FromResource (GetType(), "pattern-sample.png"); + context.Pattern = new Xwt.Drawing.ImagePattern (img.WithAlpha (0.5)); + context.Fill (); + CheckImage ("ImagePatternWithRotateTransformWithAlpha.png"); + } + + [Test] + public void ImagePatternWithScaleTransformWithAlpha () + { + InitBlank (70, 70); + context.Scale (2, 0.5); + context.Rectangle (5, 5, 20, 120); + var img = Image.FromResource (GetType(), "pattern-sample.png"); + context.Pattern = new Xwt.Drawing.ImagePattern (img.WithAlpha (0.5)); + context.Fill (); + CheckImage ("ImagePatternWithScaleTransformWithAlpha.png"); + } #endregion diff --git a/Testing/Tests/ReferenceImages/ImagePatternWithAlpha.png b/Testing/Tests/ReferenceImages/ImagePatternWithAlpha.png Binary files differnew file mode 100644 index 00000000..4b0741ba --- /dev/null +++ b/Testing/Tests/ReferenceImages/ImagePatternWithAlpha.png diff --git a/Testing/Tests/ReferenceImages/ImagePatternWithRotateTransformWithAlpha.png b/Testing/Tests/ReferenceImages/ImagePatternWithRotateTransformWithAlpha.png Binary files differnew file mode 100644 index 00000000..7138cff6 --- /dev/null +++ b/Testing/Tests/ReferenceImages/ImagePatternWithRotateTransformWithAlpha.png diff --git a/Testing/Tests/ReferenceImages/ImagePatternWithScaleTransformWithAlpha.png b/Testing/Tests/ReferenceImages/ImagePatternWithScaleTransformWithAlpha.png Binary files differnew file mode 100644 index 00000000..48a915ef --- /dev/null +++ b/Testing/Tests/ReferenceImages/ImagePatternWithScaleTransformWithAlpha.png diff --git a/Testing/Tests/ReferenceImages/ImagePatternWithTranslateTransformWithAlpha.png b/Testing/Tests/ReferenceImages/ImagePatternWithTranslateTransformWithAlpha.png Binary files differnew file mode 100644 index 00000000..9cc3a3b2 --- /dev/null +++ b/Testing/Tests/ReferenceImages/ImagePatternWithTranslateTransformWithAlpha.png diff --git a/Testing/Tests/Tests.csproj b/Testing/Tests/Tests.csproj index 67f88730..ee6b8903 100644 --- a/Testing/Tests/Tests.csproj +++ b/Testing/Tests/Tests.csproj @@ -261,6 +261,18 @@ <EmbeddedResource Include="ReferenceImages\DrawPathTwoTimes.png"> <LogicalName>DrawPathTwoTimes.png</LogicalName> </EmbeddedResource> + <EmbeddedResource Include="ReferenceImages\ImagePatternWithAlpha.png"> + <LogicalName>ImagePatternWithAlpha.png</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="ReferenceImages\ImagePatternWithRotateTransformWithAlpha.png"> + <LogicalName>ImagePatternWithRotateTransformWithAlpha.png</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="ReferenceImages\ImagePatternWithScaleTransformWithAlpha.png"> + <LogicalName>ImagePatternWithScaleTransformWithAlpha.png</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="ReferenceImages\ImagePatternWithTranslateTransformWithAlpha.png"> + <LogicalName>ImagePatternWithTranslateTransformWithAlpha.png</LogicalName> + </EmbeddedResource> </ItemGroup> <ProjectExtensions> <MonoDevelop> |