diff --git a/tests/ImageSharp.Tests/Drawing/DrawImageEffectTest.cs b/tests/ImageSharp.Tests/Drawing/DrawImageEffectTest.cs new file mode 100644 index 000000000..78f0a0870 --- /dev/null +++ b/tests/ImageSharp.Tests/Drawing/DrawImageEffectTest.cs @@ -0,0 +1,42 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests +{ + using System.IO; + using ImageSharp.PixelFormats; + using Xunit; + + public class DrawImageEffectTest : FileTestBase + { + [Fact] + public void ImageShouldApplyDrawImageFilter() + { + string path = this.CreateOutputDirectory("Drawing", "DrawImageEffect"); + + PixelTransformMode[] modes = (PixelTransformMode[])System.Enum.GetValues(typeof(PixelTransformMode)); + + using (Image blend = TestFile.Create(TestImages.Png.Blur).CreateImage()) + { + foreach (TestFile file in Files) + { + using (Image image = file.CreateImage()) + { + foreach (PixelTransformMode mode in modes) + { + using (FileStream output = File.OpenWrite($"{path}/{mode}.{file.FileName}")) + { + Size size = new Size(image.Width / 2, image.Height / 2); + Point loc = new Point(image.Width / 4, image.Height / 4); + + image.DrawImage(blend, mode, 75, size, loc).Save(output); + } + } + } + } + } + } + } +} \ No newline at end of file