Browse Source

Modified BmpPaint.cs to make it run on .NET.

svn path=/trunk/mcs/; revision=22149
Ravindra 22 years ago
parent
commit
2f03e112a6

+ 6 - 6
mcs/class/System.Drawing/Test/System.Drawing/BmpPaint.cs

@@ -33,7 +33,7 @@ public class BmpPaint {
 		Console.WriteLine("Bitmap stored to " + filename);
 	}
 	
-	static public void PaintOnBitmap (string filename) 
+	static public void PaintOnBitmap (string filename, string newname) 
 	{
 		Bitmap	bmp = new Bitmap(filename);
 		Console.WriteLine("Bitmap readed OK {0}", bmp != null);
@@ -48,19 +48,19 @@ public class BmpPaint {
 			gr.DrawRectangle(p, 20.0F, 20.0F, 60.0F, 60.0F);
 			p.Dispose();
 		}
-		bmp.Save(filename);
+		bmp.Save(newname);
 		gr.Dispose();
 		bmp.Dispose();
-		Console.WriteLine("Modified Bitmap stored to " + filename);
+		Console.WriteLine("Modified Bitmap stored to " + newname);
 	}
 	
 	static public void Main( string[] args) 
 	{
 		CreateBitmap ("file.bmp", ImageFormat.Bmp);
-		PaintOnBitmap ("file.bmp");
+		PaintOnBitmap ("file.bmp", "file-painted.bmp");
 		CreateBitmap ("file.jpg", ImageFormat.Jpeg);
-		PaintOnBitmap ("file.jpg");
+		PaintOnBitmap ("file.jpg", "file-painted.jpg");
 		CreateBitmap ("file.png", ImageFormat.Png);
-		PaintOnBitmap ("file.png");
+		PaintOnBitmap ("file.png", "file-painted.png");
 	}
 };

+ 6 - 0
mcs/class/System.Drawing/Test/System.Drawing/ChangeLog

@@ -1,3 +1,9 @@
+2004-01-16  Ravindra <[email protected]>
+	* BmpPaint.cs   did not run on .NET.
+	Modified to make it run on .NET. Specs say
+	"Do not save an image to the same stream
+	that was used to construct the image."
+
 2003-07-30  Alexandre Pigolkine <[email protected]>
 	* BmpPaint.cs 	modified