From ea4f6fa8093e0ee6997392672c23a71a7aec5c35 Mon Sep 17 00:00:00 2001 From: smallsql Date: Wed, 31 Dec 2008 15:37:28 +0000 Subject: [PATCH] Hide new public methods in BufferedImage --- awt/graphics.cs | 2 +- awt/toolkit-0.95.cs | 2 +- openjdk/java/awt/image/BufferedImage.java | 20 +++++--------------- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/awt/graphics.cs b/awt/graphics.cs index a011a3aa..5dc39512 100644 --- a/awt/graphics.cs +++ b/awt/graphics.cs @@ -950,7 +950,7 @@ namespace ikvm.awt public override java.awt.image.BufferedImage createCompatibleImage(int width, int height) { - return new BufferedImage(width, height); + return new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); } public override java.awt.image.VolatileImage createCompatibleVolatileImage(int param1, int param2, java.awt.ImageCapabilities param3) diff --git a/awt/toolkit-0.95.cs b/awt/toolkit-0.95.cs index 4cdff514..be2ca7e0 100644 --- a/awt/toolkit-0.95.cs +++ b/awt/toolkit-0.95.cs @@ -950,7 +950,7 @@ namespace ikvm.awt public java.awt.Image createImage(int width, int height) { - return new BufferedImage(width, height); + return new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); } public void disable() diff --git a/openjdk/java/awt/image/BufferedImage.java b/openjdk/java/awt/image/BufferedImage.java index ee7a08f4..7f48d462 100644 --- a/openjdk/java/awt/image/BufferedImage.java +++ b/openjdk/java/awt/image/BufferedImage.java @@ -300,25 +300,14 @@ public class BufferedImage extends java.awt.Image /** * Create a BufferedImage directly from the .NET Bitmap class */ + @cli.IKVM.Attributes.HideFromJavaAttribute.Annotation public BufferedImage(cli.System.Drawing.Bitmap bitmap){ this.imageType = TYPE_INT_ARGB; + this.colorModel = createColorModel(); this.bitmap = bitmap; this.currentBuffer = BUFFER_BITMAP; } - /** - * Create a BufferedImage with the default ColorModel of IKVM. - */ - public BufferedImage(int width, int height){ - this.imageType = TYPE_INT_ARGB; - this.bitmap = new cli.System.Drawing.Bitmap(width, height); - this.currentBuffer = BUFFER_BITMAP; - cli.System.Drawing.Graphics g = cli.System.Drawing.Graphics.FromImage(bitmap); - g.Clear(cli.System.Drawing.Color.get_White()); - g.Dispose(); - } - - /** * Constructs a BufferedImage of one of the predefined * image types. The ColorSpace for the image is the @@ -346,8 +335,8 @@ public class BufferedImage extends java.awt.Image int imageType) { this.imageType = imageType; this.colorModel = createColorModel(); - this.raster = createRaster(width, height); - this.currentBuffer = BUFFER_RASTER; + this.bitmap = new cli.System.Drawing.Bitmap(width, height); + this.currentBuffer = BUFFER_BITMAP; } /** @@ -636,6 +625,7 @@ public class BufferedImage extends java.awt.Image /** * Get the .NET Bitmap object. */ + @cli.IKVM.Attributes.HideFromJavaAttribute.Annotation public cli.System.Drawing.Bitmap getBitmap(){ raster2Bitmap(); return bitmap;