Author: spouliot
Date: 2007-01-11 13:25:58 -0500 (Thu, 11 Jan 2007)
New Revision: 70876
Modified:
trunk/mcs/class/System.Drawing/Test/System.Drawing.Imaging/ChangeLog
trunk/mcs/class/System.Drawing/Test/System.Drawing.Imaging/IconCodecTest.cs
Log:
2007-01-11 Sebastien Pouliot <[EMAIL PROTECTED]>
* IconCodecTest.cs: New test case to check loading from an Icon then
create a Bitmap from the Image. Some properties are changed in the
process (e.g. palette, flags).
Modified: trunk/mcs/class/System.Drawing/Test/System.Drawing.Imaging/ChangeLog
===================================================================
--- trunk/mcs/class/System.Drawing/Test/System.Drawing.Imaging/ChangeLog
2007-01-11 18:24:16 UTC (rev 70875)
+++ trunk/mcs/class/System.Drawing/Test/System.Drawing.Imaging/ChangeLog
2007-01-11 18:25:58 UTC (rev 70876)
@@ -1,3 +1,9 @@
+2007-01-11 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * IconCodecTest.cs: New test case to check loading from an Icon then
+ create a Bitmap from the Image. Some properties are changed in the
+ process (e.g. palette, flags).
+
2007-01-10 Sebastien Pouliot <[EMAIL PROTECTED]>
* IconCodecTest.cs: Add test cases for 48x48, 64x64 and 96x96 icons.
Modified:
trunk/mcs/class/System.Drawing/Test/System.Drawing.Imaging/IconCodecTest.cs
===================================================================
--- trunk/mcs/class/System.Drawing/Test/System.Drawing.Imaging/IconCodecTest.cs
2007-01-11 18:24:16 UTC (rev 70875)
+++ trunk/mcs/class/System.Drawing/Test/System.Drawing.Imaging/IconCodecTest.cs
2007-01-11 18:25:58 UTC (rev 70876)
@@ -71,6 +71,26 @@
return sRslt;
}
+ [Test]
+ public void Image16 ()
+ {
+ string sInFile = getInFile ("bitmaps/16x16x16.ico");
+ using (Image image = Image.FromFile (sInFile)) {
+ Assert.IsTrue (image.RawFormat.Equals
(ImageFormat.Icon), "Icon");
+ // note that image is "promoted" to 32bits
+ Assert.AreEqual (PixelFormat.Format32bppArgb,
image.PixelFormat);
+ Assert.AreEqual (73746, image.Flags,
"bmp.Flags");
+ Assert.AreEqual (16,
image.Palette.Entries.Length, "Palette");
+
+ using (Bitmap bmp = new Bitmap (image)) {
+ Assert.IsTrue (bmp.RawFormat.Equals
(ImageFormat.MemoryBmp), "Icon");
+ Assert.AreEqual
(PixelFormat.Format32bppArgb, bmp.PixelFormat);
+ Assert.AreEqual (2, bmp.Flags,
"bmp.Flags");
+ Assert.AreEqual (0,
bmp.Palette.Entries.Length, "Palette");
+ }
+ }
+ }
+
// simley.ico has 48x48, 32x32 and 16x16 images (in that order)
[Test]
public void Bitmap16Features ()
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches