@@ -14,23 +14,41 @@ public class DrawImageProcessor : IImageProcessor
14
14
/// <summary>
15
15
/// Initializes a new instance of the <see cref="DrawImageProcessor"/> class.
16
16
/// </summary>
17
- /// <param name="image ">The image to blend.</param>
17
+ /// <param name="foreground ">The image to blend.</param>
18
18
/// <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>
20
19
/// <param name="colorBlendingMode">The blending mode to use when drawing the image.</param>
21
20
/// <param name="alphaCompositionMode">The Alpha blending mode to use when drawing the image.</param>
22
21
/// <param name="opacity">The opacity of the image to blend.</param>
23
22
public DrawImageProcessor (
24
- Image image ,
23
+ Image foreground ,
25
24
Point backgroundLocation ,
26
- Rectangle foregoundRectangle ,
27
25
PixelColorBlendingMode colorBlendingMode ,
28
26
PixelAlphaCompositionMode alphaCompositionMode ,
29
27
float opacity )
28
+ : this ( foreground , backgroundLocation , foreground . Bounds , colorBlendingMode , alphaCompositionMode , opacity )
30
29
{
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 ;
32
50
this . BackgroundLocation = backgroundLocation ;
33
- this . ForegroundRectangle = foregoundRectangle ;
51
+ this . ForegroundRectangle = foregroundRectangle ;
34
52
this . ColorBlendingMode = colorBlendingMode ;
35
53
this . AlphaCompositionMode = alphaCompositionMode ;
36
54
this . Opacity = opacity ;
@@ -39,7 +57,7 @@ public DrawImageProcessor(
39
57
/// <summary>
40
58
/// Gets the image to blend.
41
59
/// </summary>
42
- public Image Image { get ; }
60
+ public Image ForeGround { get ; }
43
61
44
62
/// <summary>
45
63
/// Gets the location to draw the foreground image on the background.
@@ -71,7 +89,7 @@ public IImageProcessor<TPixelBg> CreatePixelSpecificProcessor<TPixelBg>(Configur
71
89
where TPixelBg : unmanaged, IPixel < TPixelBg >
72
90
{
73
91
ProcessorFactoryVisitor < TPixelBg > visitor = new ( configuration , this , source ) ;
74
- this . Image . AcceptVisitor ( visitor ) ;
92
+ this . ForeGround . AcceptVisitor ( visitor ) ;
75
93
return visitor . Result ! ;
76
94
}
77
95
0 commit comments