Author: spouliot
Date: 2007-06-21 14:35:02 -0400 (Thu, 21 Jun 2007)
New Revision: 80508
Modified:
trunk/mcs/class/System.Drawing/Test/System.Drawing.Imaging/ChangeLog
trunk/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestImageAttributes.cs
Log:
2007-06-21 Sebastien Pouliot <[EMAIL PROTECTED]>
* TestImageAttributes.cs: Add test case for big alpha value used in
a ColorMatrix.
Modified: trunk/mcs/class/System.Drawing/Test/System.Drawing.Imaging/ChangeLog
===================================================================
--- trunk/mcs/class/System.Drawing/Test/System.Drawing.Imaging/ChangeLog
2007-06-21 18:28:41 UTC (rev 80507)
+++ trunk/mcs/class/System.Drawing/Test/System.Drawing.Imaging/ChangeLog
2007-06-21 18:35:02 UTC (rev 80508)
@@ -1,3 +1,8 @@
+2007-06-21 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * TestImageAttributes.cs: Add test case for big alpha value used in
+ a ColorMatrix.
+
2007-05-30 Sebastien Pouliot <[EMAIL PROTECTED]>
* GifCodecTest.cs: Add test case for interlaced GIF
Modified:
trunk/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestImageAttributes.cs
===================================================================
---
trunk/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestImageAttributes.cs
2007-06-21 18:28:41 UTC (rev 80507)
+++
trunk/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestImageAttributes.cs
2007-06-21 18:35:02 UTC (rev 80508)
@@ -423,5 +423,29 @@
ia.SetColorMatrices (global_color_matrix,
global_color_matrix, ColorMatrixFlag.Default, (ColorAdjustType) Int32.MinValue);
}
}
+
+ [Test]
+ public void BigAlpha ()
+ {
+ ColorMatrix cm = new ColorMatrix (new float[][] {
+ new float[] {1, 0, 0, 0,
0}, //R
+ new float[] {0, 1, 0, 0,
0}, //G
+ new float[] {0, 0, 1, 0,
0}, //B
+ new float[] {0, 0, 0, 253,
0}, //A
+ new float[] {0, 0, 0, 0,
1}, //Translation
+ });
+
+ using (Bitmap bmp = new Bitmap (1, 1)) {
+ bmp.SetPixel (0, 0, Color.White);
+ using (Bitmap b = new Bitmap (1, 1)) {
+ using (Graphics g = Graphics.FromImage
(b)) {
+ ImageAttributes ia = new
ImageAttributes ();
+ ia.SetColorMatrix (cm);
+ g.DrawImage (bmp, new Rectangle
(0, 0, 1, 1), 0, 0, 1, 1, GraphicsUnit.Pixel, ia);
+ Assert.AreEqual (Color.FromArgb
(3, 255, 255, 255), b.GetPixel (0,0), "0,0");
+ }
+ }
+ }
+ }
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches