[Mono-bugs] [Bug 80842][Nor] Changed - DrawImage doesn't strech image exactly like MS GDI+

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Apr 12 16:11:59 EDT 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by sebastien at ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=80842

--- shadow/80842	2007-04-11 10:46:58.000000000 -0400
+++ shadow/80842.tmp.4859	2007-04-12 16:11:59.000000000 -0400
@@ -11,13 +11,13 @@
 AssignedTo: mono-bugs at ximian.com                            
 ReportedBy: monkey at jpobst.com               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
-Summary: ImageList messes up GetPixel/SetPixel on *nix
+Summary: DrawImage doesn't strech image exactly like MS GDI+
 
 The following test works on .Net and winmono, but fails on the mono 1.2.3
 suse vmware image:
 
 [Test]
 public void SetPixelTest ()
@@ -114,6 +114,39 @@
 
 
 ------- Additional Comments From sebastien at ximian.com  2007-04-11 10:46 -------
 Created an attachment (id=19031)
 ms.net / windows
 
+
+------- Additional Comments From sebastien at ximian.com  2007-04-12 16:11 -------
+Test case without ImageList (or MWF). Updating summary description.
+
+using System;
+using System.Drawing;
+using System.Drawing.Imaging;
+
+public class Program {
+
+	static void Main ()
+	{
+		Bitmap b = new Bitmap (1, 1);
+		b.SetPixel (0, 0, Color.FromArgb (0, 128, 0));
+		Console.WriteLine (b.GetPixel (0, 0).ToArgb ().ToString ("X8"));
+
+		using (Bitmap large = new Bitmap (16, 16, PixelFormat.Format32bppRgb)) {
+			using (Graphics g = Graphics.FromImage (large)) {
+				g.DrawImage (b, new Rectangle (0, 0, 16, 16), 0, 0, 1, 1,
+GraphicsUnit.Pixel, null);
+			}
+			for (int y = 0; y < large.Height; y++) {
+				for (int x = 0; x < large.Width; x++) {
+					Console.Write ("{0}\t", large.GetPixel (y, x).ToArgb ().ToString
+("X8"));
+				}
+				Console.WriteLine ();
+			}
+			large.Save ("80842b.png", ImageFormat.Png);
+		}
+	}
+}
+


More information about the mono-bugs mailing list