@@ -14,23 +14,41 @@ public class DrawImageProcessor : IImageProcessor
1414 /// <summary>
1515 /// Initializes a new instance of the <see cref="DrawImageProcessor"/> class.
1616 /// </summary>
17- /// <param name="image ">The image to blend.</param>
17+ /// <param name="foreground ">The image to blend.</param>
1818 /// <param name="backgroundLocation">The location to draw the foreground image on the background.</param>
19- /// <param name="foregoundRectangle">The rectangular portion of the foreground image to draw.</param>
2019 /// <param name="colorBlendingMode">The blending mode to use when drawing the image.</param>
2120 /// <param name="alphaCompositionMode">The Alpha blending mode to use when drawing the image.</param>
2221 /// <param name="opacity">The opacity of the image to blend.</param>
2322 public DrawImageProcessor (
24- Image image ,
23+ Image foreground ,
2524 Point backgroundLocation ,
26- Rectangle foregoundRectangle ,
2725 PixelColorBlendingMode colorBlendingMode ,
2826 PixelAlphaCompositionMode alphaCompositionMode ,
2927 float opacity )
28+ : this ( foreground , backgroundLocation , foreground . Bounds , colorBlendingMode , alphaCompositionMode , opacity )
3029 {
31- this . Image = image ;
30+ }
31+
32+ /// <summary>
33+ /// Initializes a new instance of the <see cref="DrawImageProcessor"/> class.
34+ /// </summary>
35+ /// <param name="foreground">The image to blend.</param>
36+ /// <param name="backgroundLocation">The location to draw the foreground image on the background.</param>
37+ /// <param name="foregroundRectangle">The rectangular portion of the foreground image to draw.</param>
38+ /// <param name="colorBlendingMode">The blending mode to use when drawing the image.</param>
39+ /// <param name="alphaCompositionMode">The Alpha blending mode to use when drawing the image.</param>
40+ /// <param name="opacity">The opacity of the image to blend.</param>
41+ public DrawImageProcessor (
42+ Image foreground ,
43+ Point backgroundLocation ,
44+ Rectangle foregroundRectangle ,
45+ PixelColorBlendingMode colorBlendingMode ,
46+ PixelAlphaCompositionMode alphaCompositionMode ,
47+ float opacity )
48+ {
49+ this . ForeGround = foreground ;
3250 this . BackgroundLocation = backgroundLocation ;
33- this . ForegroundRectangle = foregoundRectangle ;
51+ this . ForegroundRectangle = foregroundRectangle ;
3452 this . ColorBlendingMode = colorBlendingMode ;
3553 this . AlphaCompositionMode = alphaCompositionMode ;
3654 this . Opacity = opacity ;
@@ -39,7 +57,7 @@ public DrawImageProcessor(
3957 /// <summary>
4058 /// Gets the image to blend.
4159 /// </summary>
42- public Image Image { get ; }
60+ public Image ForeGround { get ; }
4361
4462 /// <summary>
4563 /// Gets the location to draw the foreground image on the background.
@@ -71,7 +89,7 @@ public IImageProcessor<TPixelBg> CreatePixelSpecificProcessor<TPixelBg>(Configur
7189 where TPixelBg : unmanaged, IPixel < TPixelBg >
7290 {
7391 ProcessorFactoryVisitor < TPixelBg > visitor = new ( configuration , this , source ) ;
74- this . Image . AcceptVisitor ( visitor ) ;
92+ this . ForeGround . AcceptVisitor ( visitor ) ;
7593 return visitor . Result ! ;
7694 }
7795
0 commit comments