diff --git a/Sources/Imaging/Microsoft.Psi.Imaging/ImageExtensions.cs b/Sources/Imaging/Microsoft.Psi.Imaging/ImageExtensions.cs
index feecf6468..142ee54ec 100644
--- a/Sources/Imaging/Microsoft.Psi.Imaging/ImageExtensions.cs
+++ b/Sources/Imaging/Microsoft.Psi.Imaging/ImageExtensions.cs
@@ -1375,6 +1375,142 @@ public static void DrawCircle(this Image image, Point p0, int radius, Color colo
drawFormat.FormatFlags = 0;
graphics.DrawString(str, drawFont, drawBrush, p0.X, p0.Y, drawFormat);
}
+
+ ///
+ /// Renders text on the image at the specified pixel (p0).
+ ///
+ /// Image to draw on.
+ /// Text to render.
+ /// Pixel coordinates for upper-left corner of the text.
+ /// Background color to use when drawing text.
+ /// Color to use to draw the text.
+ /// Name of font to use. Optional.
+ /// Size of font. Optional.
+ public static void DrawText(this Image image, string str, Point p0, Color backgroundColor, Color textColor, string font = "Arial", float fontSize = 24.0f)
+ {
+ if (image.PixelFormat == PixelFormat.Gray_16bpp || image.PixelFormat == PixelFormat.RGBA_64bpp)
+ {
+ throw new InvalidOperationException(
+ "Drawing on 16bpp and 64bpp images is not currently supported. " +
+ "Convert to a supported format such as 8bpp grayscale or 24/32bpp color first.");
+ }
+
+ // If our image is 8bpp we won't be able to call Graphics.FromImage because
+ // that call doesn't support the 8bpp pixel format. See:
+ // https://docs.microsoft.com/en-us/dotnet/api/system.drawing.graphics.fromimage?view=dotnet-plat-ext-3.1
+ // for details.
+ //
+ // Additionally, there is no corresponding System pixel format for RGB 24bpp.
+ //
+ // To work around these issues, we will convert the image to 24bpp, perform the operation,
+ // and then convert back to the original format.
+ if (image.PixelFormat == PixelFormat.Gray_8bpp || image.PixelFormat == PixelFormat.RGB_24bpp)
+ {
+ int stride = 4 * ((image.Width * 3 + 3) / 2); // Rounding to nearest word boundary
+ using var tmpImage = new Image(image.Width, image.Height, stride, PixelFormat.BGR_24bpp);
+ image.CopyTo(tmpImage);
+ tmpImage.DrawText(str, p0, backgroundColor, textColor, font, fontSize);
+ image.CopyFrom(tmpImage);
+ return;
+ }
+
+ font ??= "Arial";
+ using Bitmap bm = image.ToBitmap(false);
+ using var graphics = Graphics.FromImage(bm);
+ using Font drawFont = new Font(font, fontSize);
+ using SolidBrush textBrush = new SolidBrush(textColor);
+ using SolidBrush backgroundBrush = new SolidBrush(backgroundColor);
+ using StringFormat drawFormat = new StringFormat();
+ drawFormat.FormatFlags = 0;
+
+ SizeF textSize = graphics.MeasureString(str, drawFont);
+
+ // Drawing the background before drawing the text
+ var bg = new RectangleF(p0.X, p0.Y, textSize.Width, textSize.Height);
+ graphics.FillRectangle(backgroundBrush, bg);
+ graphics.DrawString(str, drawFont, textBrush, p0.X, p0.Y, drawFormat);
+ }
+
+ ///
+ /// Fills a rectangle at the specified pixel coordinates on the image.
+ ///
+ /// Image to draw on.
+ /// Pixel coordinates for rectangle.
+ /// Color to use for drawing.
+ public static void FillRectangle(this Image image, Rectangle rect, Color color)
+ {
+ if (image.PixelFormat == PixelFormat.Gray_16bpp || image.PixelFormat == PixelFormat.RGBA_64bpp)
+ {
+ throw new InvalidOperationException(
+ "Drawing on 16bpp and 64bpp images is not currently supported. " +
+ "Convert to a supported format such as 8bpp grayscale or 24/32bpp color first.");
+ }
+
+ // If our image is 8bpp we won't be able to call Graphics.FromImage because
+ // that call doesn't support the 8bpp pixel format. See:
+ // https://docs.microsoft.com/en-us/dotnet/api/system.drawing.graphics.fromimage?view=dotnet-plat-ext-3.1
+ // for details.
+ //
+ // Additionally, there is no corresponding System pixel format for RGB 24bpp.
+ //
+ // To work around these issues, we will convert the image to 24bpp, perform the operation,
+ // and then convert back to the original format.
+ if (image.PixelFormat == PixelFormat.Gray_8bpp || image.PixelFormat == PixelFormat.RGB_24bpp)
+ {
+ int stride = 4 * ((image.Width * 3 + 3) / 2); // Rounding to nearest word boundary
+ using var tmpImage = new Image(image.Width, image.Height, stride, PixelFormat.BGR_24bpp);
+ image.CopyTo(tmpImage);
+ tmpImage.FillRectangle(rect, color);
+ image.CopyFrom(tmpImage);
+ return;
+ }
+
+ using Bitmap bm = image.ToBitmap(false);
+ using var graphics = Graphics.FromImage(bm);
+ using var drawingBrush = new SolidBrush(color);
+ graphics.FillRectangle(drawingBrush, rect);
+ }
+
+ ///
+ /// Fills a circle centered at the specified pixel (p0) with the specified radius.
+ ///
+ /// Image to draw on.
+ /// Pixel coordinates for center of circle.
+ /// Radius of the circle.
+ /// Color to use for drawing.
+ public static void FillCircle(this Image image, Point p0, int radius, Color color)
+ {
+ if (image.PixelFormat == PixelFormat.Gray_16bpp || image.PixelFormat == PixelFormat.RGBA_64bpp)
+ {
+ throw new InvalidOperationException(
+ "Drawing on 16bpp and 64bpp images is not currently supported. " +
+ "Convert to a supported format such as 8bpp grayscale or 24/32bpp color first.");
+ }
+
+ // If our image is 8bpp we won't be able to call Graphics.FromImage because
+ // that call doesn't support the 8bpp pixel format. See:
+ // https://docs.microsoft.com/en-us/dotnet/api/system.drawing.graphics.fromimage?view=dotnet-plat-ext-3.1
+ // for details.
+ //
+ // Additionally, there is no corresponding System pixel format for RGB 24bpp.
+ //
+ // To work around these issues, we will convert the image to 24bpp, perform the operation,
+ // and then convert back to the original format.
+ if (image.PixelFormat == PixelFormat.Gray_8bpp || image.PixelFormat == PixelFormat.RGB_24bpp)
+ {
+ int stride = 4 * ((image.Width * 3 + 3) / 2); // Rounding to nearest word boundary
+ using var tmpImage = new Image(image.Width, image.Height, stride, PixelFormat.BGR_24bpp);
+ image.CopyTo(tmpImage);
+ tmpImage.FillCircle(p0, radius, color);
+ image.CopyFrom(tmpImage);
+ return;
+ }
+
+ using Bitmap bm = image.ToBitmap(false);
+ using var graphics = Graphics.FromImage(bm);
+ using var drawingBrush = new SolidBrush(color);
+ graphics.FillEllipse(drawingBrush, p0.X - radius, p0.Y - radius, 2 * radius, 2 * radius);
+ }
}
///
diff --git a/Sources/Imaging/Microsoft.Psi.Imaging/StreamOperators.cs b/Sources/Imaging/Microsoft.Psi.Imaging/StreamOperators.cs
index 0d96c8a36..ac7dca888 100644
--- a/Sources/Imaging/Microsoft.Psi.Imaging/StreamOperators.cs
+++ b/Sources/Imaging/Microsoft.Psi.Imaging/StreamOperators.cs
@@ -368,6 +368,77 @@ public static IProducer> DrawText(this IProducer> so
drawTextSharedImage.Resource.DrawText(text, p0, color, font, fontSize);
emitter.Post(drawTextSharedImage, envelope.OriginatingTime);
}, deliveryPolicy);
+ }
+
+ ///
+ /// Draws a piece of text with background over a shared image.
+ ///
+ /// Image to draw text on.
+ /// Text to render.
+ /// Coordinates for start of text (in pixels).
+ /// Background color to use when drawing text.
+ /// Color to use to draw the text.
+ /// Name of font to use. Optional.
+ /// Size of font. Optional.
+ /// An optional delivery policy.
+ /// Optional image allocator to create new shared image.
+ /// Returns a producer that generates images overdrawn with text.
+ public static IProducer> DrawText(this IProducer> source, string text, Point p0, Color backgroundColor, Color textColor, string font = null, float fontSize = 24.0f, DeliveryPolicy> deliveryPolicy = null, Func> sharedImageAllocator = null)
+ {
+ sharedImageAllocator ??= ImagePool.GetOrCreate;
+ return source.Process, Shared>(
+ (sharedImage, envelope, emitter) =>
+ {
+ using var drawTextSharedImage = sharedImageAllocator(sharedImage.Resource.Width, sharedImage.Resource.Height, sharedImage.Resource.PixelFormat);
+ drawTextSharedImage.Resource.CopyFrom(sharedImage.Resource);
+ drawTextSharedImage.Resource.DrawText(text, p0, backgroundColor, textColor, font, fontSize);
+ emitter.Post(drawTextSharedImage, envelope.OriginatingTime);
+ }, deliveryPolicy);
+ }
+
+ ///
+ /// Fills a rectangle over a shared image.
+ ///
+ /// Image to draw rectangle on.
+ /// Pixel coordinates for rectangle.
+ /// Color to use when drawing the rectangle.
+ /// An optional delivery policy.
+ /// Optional image allocator to create new shared image.
+ /// Returns a producer that generates images overdrawn with a rectangle.
+ public static IProducer> FillRectangle(this IProducer> source, Rectangle rect, Color color, DeliveryPolicy> deliveryPolicy = null, Func> sharedImageAllocator = null)
+ {
+ sharedImageAllocator ??= ImagePool.GetOrCreate;
+ return source.Process, Shared>(
+ (sharedImage, envelope, emitter) =>
+ {
+ using var drawRectSharedImage = sharedImageAllocator(sharedImage.Resource.Width, sharedImage.Resource.Height, sharedImage.Resource.PixelFormat);
+ drawRectSharedImage.Resource.CopyFrom(sharedImage.Resource);
+ drawRectSharedImage.Resource.FillRectangle(rect, color);
+ emitter.Post(drawRectSharedImage, envelope.OriginatingTime);
+ }, deliveryPolicy);
+ }
+
+ ///
+ /// Fills a circle over a shared image.
+ ///
+ /// Image to draw circle on.
+ /// Center of circle (in pixels).
+ /// Radius of circle (in pixels).
+ /// Color to use when drawing the circle.
+ /// An optional delivery policy.
+ /// Optional image allocator to create new shared image.
+ /// Returns a producer that generates images overdrawn with a circle.
+ public static IProducer> FillCircle(this IProducer> source, Point p0, int radius, Color color, DeliveryPolicy> deliveryPolicy = null, Func> sharedImageAllocator = null)
+ {
+ sharedImageAllocator ??= ImagePool.GetOrCreate;
+ return source.Process, Shared>(
+ (sharedImage, envelope, emitter) =>
+ {
+ using var drawCircleSharedImage = sharedImageAllocator(sharedImage.Resource.Width, sharedImage.Resource.Height, sharedImage.Resource.PixelFormat);
+ drawCircleSharedImage.Resource.CopyFrom(sharedImage.Resource);
+ drawCircleSharedImage.Resource.FillCircle(p0, radius, color);
+ emitter.Post(drawCircleSharedImage, envelope.OriginatingTime);
+ }, deliveryPolicy);
}
///
diff --git a/Sources/Imaging/Test.Psi.Imaging.Windows/ImageTester.cs b/Sources/Imaging/Test.Psi.Imaging.Windows/ImageTester.cs
index 7149f4c59..4a54faced 100644
--- a/Sources/Imaging/Test.Psi.Imaging.Windows/ImageTester.cs
+++ b/Sources/Imaging/Test.Psi.Imaging.Windows/ImageTester.cs
@@ -20,6 +20,9 @@ public class ImageTester
private Image testImage_GrayDrawLine = Image.FromBitmap(Properties.Resources.TestImage_GrayDrawLine);
private Image testImage_GrayDrawRect = Image.FromBitmap(Properties.Resources.TestImage_GrayDrawRect);
private Image testImage_GrayDrawText = Image.FromBitmap(Properties.Resources.TestImage_GrayDrawText);
+ private Image testImage_GrayFillRect = Image.FromBitmap(Properties.Resources.TestImage_GrayFillRect);
+ private Image testImage_GrayFillCircle = Image.FromBitmap(Properties.Resources.TestImage_GrayFillCircle);
+ private Image testImage_GrayDrawTextWithBackground = Image.FromBitmap(Properties.Resources.TestImage_GrayDrawTextWithBackground);
private Image testImage_GrayFlip = Image.FromBitmap(Properties.Resources.TestImage_GrayFlip);
private Image testImage_GrayResized = Image.FromBitmap(Properties.Resources.TestImage_GrayResized);
private Image testImage_GrayRotate = Image.FromBitmap(Properties.Resources.TestImage_GrayRotate);
@@ -44,6 +47,9 @@ public class ImageTester
private Image testImage2_DrawLine = Image.FromBitmap(Properties.Resources.TestImage2_DrawLine);
private Image testImage2_DrawCircle = Image.FromBitmap(Properties.Resources.TestImage2_DrawCircle);
private Image testImage2_DrawText = Image.FromBitmap(Properties.Resources.TestImage2_DrawText);
+ private Image testImage2_FillRect = Image.FromBitmap(Properties.Resources.TestImage2_FillRect);
+ private Image testImage2_FillCircle = Image.FromBitmap(Properties.Resources.TestImage2_FillCircle);
+ private Image testImage2_DrawTextWithBackground = Image.FromBitmap(Properties.Resources.TestImage2_DrawTextWithBackground);
private Image testImage2_AbsDiff = Image.FromBitmap(Properties.Resources.TestImage2_AbsDiff);
private Image testImage_0_0_200_100 = Image.FromBitmap(Properties.Resources.TestImage_Crop_0_0_200_100);
private Image testImage_153_57_103_199 = Image.FromBitmap(Properties.Resources.TestImage_Crop_153_57_103_199);
@@ -93,6 +99,36 @@ public void Image_GrayDrawText()
this.AssertAreImagesEqual(this.testImage_GrayDrawText, sharedImage.Resource);
}
+ [TestMethod]
+ [Timeout(60000)]
+ public void Image_GrayDrawTextWithBackground()
+ {
+ using var sharedImage = ImagePool.GetOrCreate(this.testImage_Gray.Width, this.testImage_Gray.Height, this.testImage_Gray.PixelFormat);
+ this.testImage_Gray.CopyTo(sharedImage.Resource);
+ sharedImage.Resource.DrawText("Test", new System.Drawing.Point(0, 20), System.Drawing.Color.Red, System.Drawing.Color.White);
+ this.AssertAreImagesEqual(this.testImage_GrayDrawTextWithBackground, sharedImage.Resource);
+ }
+
+ [TestMethod]
+ [Timeout(60000)]
+ public void Image_GrayFillRect()
+ {
+ using var sharedImage = ImagePool.GetOrCreate(this.testImage_Gray.Width, this.testImage_Gray.Height, this.testImage_Gray.PixelFormat);
+ this.testImage_Gray.CopyTo(sharedImage.Resource);
+ sharedImage.Resource.FillRectangle(new System.Drawing.Rectangle(0, 0, 20, 20), System.Drawing.Color.White);
+ this.AssertAreImagesEqual(this.testImage_GrayFillRect, sharedImage.Resource);
+ }
+
+ [TestMethod]
+ [Timeout(60000)]
+ public void Image_GrayFillCircle()
+ {
+ using var sharedImage = ImagePool.GetOrCreate(this.testImage_Gray.Width, this.testImage_Gray.Height, this.testImage_Gray.PixelFormat);
+ this.testImage_Gray.CopyTo(sharedImage.Resource);
+ sharedImage.Resource.FillCircle(new System.Drawing.Point(this.testImage_Gray.Width / 2, this.testImage_Gray.Height / 2), 100, System.Drawing.Color.White);
+ this.AssertAreImagesEqual(this.testImage_GrayFillCircle, sharedImage.Resource);
+ }
+
[TestMethod]
[Timeout(60000)]
public void Image_GrayFlip()
@@ -529,6 +565,66 @@ public void Image_DrawTextViaOperator(PixelFormat pixelFormat)
pipeline.Run();
}
+ [TestMethod]
+ [Timeout(60000)]
+ [DataRow(PixelFormat.Gray_8bpp)]
+ [DataRow(PixelFormat.BGR_24bpp)]
+ [DataRow(PixelFormat.BGRX_32bpp)]
+ [DataRow(PixelFormat.BGRA_32bpp)]
+ [DataRow(PixelFormat.RGB_24bpp)]
+ public void Image_DrawTextWithBackgroundViaOperator(PixelFormat pixelFormat)
+ {
+ using var pipeline = Pipeline.Create("DrawTextWithBackgroundViaOperator");
+ using var sharedImage = ImagePool.GetOrCreate(this.testImage2.Width, this.testImage2.Height, pixelFormat);
+ this.testImage2.CopyTo(sharedImage.Resource);
+ Generators.Sequence(pipeline, new[] { sharedImage }, default, null, keepOpen: false).DrawText("Testing", new System.Drawing.Point(100, 100), System.Drawing.Color.Red, System.Drawing.Color.White).Do((img) =>
+ {
+ using var refImage = this.testImage2_DrawTextWithBackground.Convert(pixelFormat);
+ this.AssertAreImagesEqual(refImage, img.Resource);
+ });
+ pipeline.Run();
+ }
+
+ [TestMethod]
+ [Timeout(60000)]
+ [DataRow(PixelFormat.Gray_8bpp)]
+ [DataRow(PixelFormat.BGR_24bpp)]
+ [DataRow(PixelFormat.BGRX_32bpp)]
+ [DataRow(PixelFormat.BGRA_32bpp)]
+ [DataRow(PixelFormat.RGB_24bpp)]
+ public void Image_FillRectangleViaOperator(PixelFormat pixelFormat)
+ {
+ using var pipeline = Pipeline.Create("FillRectangleViaOperator");
+ using var sharedImage = ImagePool.GetOrCreate(this.testImage2.Width, this.testImage2.Height, pixelFormat);
+ this.testImage2.CopyTo(sharedImage.Resource);
+ Generators.Sequence(pipeline, new[] { sharedImage }, default, null, keepOpen: false).FillRectangle(new System.Drawing.Rectangle(20, 20, 255, 255), System.Drawing.Color.White).Do((img) =>
+ {
+ using var refImage = this.testImage2_FillRect.Convert(pixelFormat);
+ this.AssertAreImagesEqual(refImage, img.Resource);
+ });
+ pipeline.Run();
+ }
+
+ [TestMethod]
+ [Timeout(60000)]
+ [DataRow(PixelFormat.Gray_8bpp)]
+ [DataRow(PixelFormat.BGR_24bpp)]
+ [DataRow(PixelFormat.BGRX_32bpp)]
+ [DataRow(PixelFormat.BGRA_32bpp)]
+ [DataRow(PixelFormat.RGB_24bpp)]
+ public void Image_FillCircleViaOperator(PixelFormat pixelFormat)
+ {
+ using var pipeline = Pipeline.Create("FillCircleViaOperator");
+ using var sharedImage = ImagePool.GetOrCreate(this.testImage2.Width, this.testImage2.Height, pixelFormat);
+ this.testImage2.CopyTo(sharedImage.Resource);
+ Generators.Sequence(pipeline, new[] { sharedImage }, default, null, keepOpen: false).FillCircle(new System.Drawing.Point(250, 250), 100, System.Drawing.Color.White).Do((img) =>
+ {
+ using var refImage = this.testImage2_FillCircle.Convert(pixelFormat);
+ this.AssertAreImagesEqual(refImage, img.Resource);
+ });
+ pipeline.Run();
+ }
+
[TestMethod]
[Timeout(60000)]
[DataRow(PixelFormat.Gray_8bpp)]
diff --git a/Sources/Imaging/Test.Psi.Imaging.Windows/Properties/Resources.Designer.cs b/Sources/Imaging/Test.Psi.Imaging.Windows/Properties/Resources.Designer.cs
index 447a85512..5d0332fa2 100644
--- a/Sources/Imaging/Test.Psi.Imaging.Windows/Properties/Resources.Designer.cs
+++ b/Sources/Imaging/Test.Psi.Imaging.Windows/Properties/Resources.Designer.cs
@@ -160,6 +160,36 @@ internal static System.Drawing.Bitmap TestImage_GrayDrawText {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap TestImage_GrayDrawTextWithBackground {
+ get {
+ object obj = ResourceManager.GetObject("TestImage_GrayDrawTextWithBackground", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap TestImage_GrayFillCircle {
+ get {
+ object obj = ResourceManager.GetObject("TestImage_GrayFillCircle", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap TestImage_GrayFillRect {
+ get {
+ object obj = ResourceManager.GetObject("TestImage_GrayFillRect", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -320,6 +350,36 @@ internal static System.Drawing.Bitmap TestImage2_DrawText {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap TestImage2_DrawTextWithBackground {
+ get {
+ object obj = ResourceManager.GetObject("TestImage2_DrawTextWithBackground", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap TestImage2_FillCircle {
+ get {
+ object obj = ResourceManager.GetObject("TestImage2_FillCircle", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap TestImage2_FillRect {
+ get {
+ object obj = ResourceManager.GetObject("TestImage2_FillRect", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
diff --git a/Sources/Imaging/Test.Psi.Imaging.Windows/Properties/Resources.resx b/Sources/Imaging/Test.Psi.Imaging.Windows/Properties/Resources.resx
index abee9760d..5191ce539 100644
--- a/Sources/Imaging/Test.Psi.Imaging.Windows/Properties/Resources.resx
+++ b/Sources/Imaging/Test.Psi.Imaging.Windows/Properties/Resources.resx
@@ -232,4 +232,22 @@
..\Resources\TestImage_SetPixel.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\TestImage2_DrawTextWithBackground.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\TestImage_GrayDrawTextWithBackground.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\TestImage_GrayFillCircle.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\TestImage_GrayFillRect.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\TestImage2_FillCircle.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\TestImage2_FillRect.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
\ No newline at end of file
diff --git a/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage2_DrawTextWithBackground.bmp b/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage2_DrawTextWithBackground.bmp
new file mode 100644
index 000000000..e40dc01c5
Binary files /dev/null and b/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage2_DrawTextWithBackground.bmp differ
diff --git a/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage2_FillCircle.bmp b/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage2_FillCircle.bmp
new file mode 100644
index 000000000..b8e4a275b
Binary files /dev/null and b/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage2_FillCircle.bmp differ
diff --git a/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage2_FillRect.bmp b/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage2_FillRect.bmp
new file mode 100644
index 000000000..fe5cbf9f4
Binary files /dev/null and b/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage2_FillRect.bmp differ
diff --git a/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage_GrayDrawTextWithBackground.bmp b/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage_GrayDrawTextWithBackground.bmp
new file mode 100644
index 000000000..b8e21a0b1
Binary files /dev/null and b/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage_GrayDrawTextWithBackground.bmp differ
diff --git a/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage_GrayFillCircle.bmp b/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage_GrayFillCircle.bmp
new file mode 100644
index 000000000..b342b6eb9
Binary files /dev/null and b/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage_GrayFillCircle.bmp differ
diff --git a/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage_GrayFillRect.bmp b/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage_GrayFillRect.bmp
new file mode 100644
index 000000000..9ada2a3e6
Binary files /dev/null and b/Sources/Imaging/Test.Psi.Imaging.Windows/Resources/TestImage_GrayFillRect.bmp differ
diff --git a/Sources/Imaging/Test.Psi.Imaging.Windows/Test.Psi.Imaging.Windows.csproj b/Sources/Imaging/Test.Psi.Imaging.Windows/Test.Psi.Imaging.Windows.csproj
index 6c8c7b538..b3ad25e6a 100644
--- a/Sources/Imaging/Test.Psi.Imaging.Windows/Test.Psi.Imaging.Windows.csproj
+++ b/Sources/Imaging/Test.Psi.Imaging.Windows/Test.Psi.Imaging.Windows.csproj
@@ -154,6 +154,9 @@
+
+
+
@@ -170,6 +173,9 @@
+
+
+