diff --git a/src/ImageSharp/Processing/Processors/Drawing/DrawImageProcessor.cs b/src/ImageSharp/Processing/Processors/Drawing/DrawImageProcessor.cs index 98c17dc90..6ecf16fc6 100644 --- a/src/ImageSharp/Processing/Processors/Drawing/DrawImageProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Drawing/DrawImageProcessor.cs @@ -14,23 +14,41 @@ public class DrawImageProcessor : IImageProcessor /// /// Initializes a new instance of the class. /// - /// The image to blend. + /// The image to blend. /// The location to draw the foreground image on the background. - /// The rectangular portion of the foreground image to draw. /// The blending mode to use when drawing the image. /// The Alpha blending mode to use when drawing the image. /// The opacity of the image to blend. public DrawImageProcessor( - Image image, + Image foreground, Point backgroundLocation, - Rectangle foregoundRectangle, PixelColorBlendingMode colorBlendingMode, PixelAlphaCompositionMode alphaCompositionMode, float opacity) + : this(foreground, backgroundLocation, foreground.Bounds, colorBlendingMode, alphaCompositionMode, opacity) { - this.Image = image; + } + + /// + /// Initializes a new instance of the class. + /// + /// The image to blend. + /// The location to draw the foreground image on the background. + /// The rectangular portion of the foreground image to draw. + /// The blending mode to use when drawing the image. + /// The Alpha blending mode to use when drawing the image. + /// The opacity of the image to blend. + public DrawImageProcessor( + Image foreground, + Point backgroundLocation, + Rectangle foregroundRectangle, + PixelColorBlendingMode colorBlendingMode, + PixelAlphaCompositionMode alphaCompositionMode, + float opacity) + { + this.ForeGround = foreground; this.BackgroundLocation = backgroundLocation; - this.ForegroundRectangle = foregoundRectangle; + this.ForegroundRectangle = foregroundRectangle; this.ColorBlendingMode = colorBlendingMode; this.AlphaCompositionMode = alphaCompositionMode; this.Opacity = opacity; @@ -39,7 +57,7 @@ public class DrawImageProcessor : IImageProcessor /// /// Gets the image to blend. /// - public Image Image { get; } + public Image ForeGround { get; } /// /// Gets the location to draw the foreground image on the background. @@ -71,7 +89,7 @@ public class DrawImageProcessor : IImageProcessor where TPixelBg : unmanaged, IPixel { ProcessorFactoryVisitor visitor = new(configuration, this, source); - this.Image.AcceptVisitor(visitor); + this.ForeGround.AcceptVisitor(visitor); return visitor.Result!; } diff --git a/tests/ImageSharp.Tests/TestImages.cs b/tests/ImageSharp.Tests/TestImages.cs index 47e1809fc..ee22c3541 100644 --- a/tests/ImageSharp.Tests/TestImages.cs +++ b/tests/ImageSharp.Tests/TestImages.cs @@ -133,7 +133,7 @@ public static class TestImages public const string Issue2259 = "Png/issues/Issue_2259.png"; // Issue 2447: https://github.com/SixLabors/ImageSharp/issues/2447 - public const string Issue2447 = "Png/issues/Issue_2447.png"; + public const string Issue2447 = "Png/issues/issue_2447.png"; public static class Bad {