@@ -22,14 +22,17 @@ public static class DrawImageExtensions
2222 public static IImageProcessingContext DrawImage (
2323 this IImageProcessingContext source ,
2424 Image image ,
25- float opacity ) =>
26- source . ApplyProcessor (
25+ float opacity )
26+ {
27+ var options = new GraphicsOptions ( ) ;
28+ return source . ApplyProcessor (
2729 new DrawImageProcessor (
28- image ,
29- Point . Empty ,
30- new GraphicsOptions ( ) . ColorBlendingMode ,
31- new GraphicsOptions ( ) . AlphaCompositionMode ,
32- opacity ) ) ;
30+ image ,
31+ Point . Empty ,
32+ options . ColorBlendingMode ,
33+ options . AlphaCompositionMode ,
34+ opacity ) ) ;
35+ }
3336
3437 /// <summary>
3538 /// Draws the given image together with the current one by blending their pixels.
@@ -100,14 +103,17 @@ public static IImageProcessingContext DrawImage(
100103 this IImageProcessingContext source ,
101104 Image image ,
102105 Point location ,
103- float opacity ) =>
104- source . ApplyProcessor (
106+ float opacity )
107+ {
108+ var options = new GraphicsOptions ( ) ;
109+ return source . ApplyProcessor (
105110 new DrawImageProcessor (
106- image ,
107- location ,
108- new GraphicsOptions ( ) . ColorBlendingMode ,
109- new GraphicsOptions ( ) . AlphaCompositionMode ,
110- opacity ) ) ;
111+ image ,
112+ location ,
113+ options . ColorBlendingMode ,
114+ options . AlphaCompositionMode ,
115+ opacity ) ) ;
116+ }
111117
112118 /// <summary>
113119 /// Draws the given image together with the current one by blending their pixels.
@@ -172,4 +178,4 @@ public static IImageProcessingContext DrawImage(
172178 options . AlphaCompositionMode ,
173179 options . BlendPercentage ) ) ;
174180 }
175- }
181+ }
0 commit comments