replaced Image with BufferedImage

master
melvin 2011-07-29 10:35:22 +08:00
parent 4f0298c145
commit f349e9bea9
1 changed files with 3 additions and 4 deletions

View File

@ -2,7 +2,6 @@ package magic.ui.widget;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.awt.image.RescaleOp; import java.awt.image.RescaleOp;
@ -12,7 +11,7 @@ public class TransparentImagePanel extends JPanel {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Image image=null; private BufferedImage image=null;
private RescaleOp rescaleOp=null; private RescaleOp rescaleOp=null;
public void setOpacity(final float opacity) { public void setOpacity(final float opacity) {
@ -27,7 +26,7 @@ public class TransparentImagePanel extends JPanel {
} }
} }
public void setImage(final Image image) { public void setImage(final BufferedImage image) {
this.image=image; this.image=image;
} }
@ -39,7 +38,7 @@ public class TransparentImagePanel extends JPanel {
g.drawImage(image,0,0,this); g.drawImage(image,0,0,this);
} else { } else {
final Graphics2D g2d=(Graphics2D)g; final Graphics2D g2d=(Graphics2D)g;
g2d.drawImage((BufferedImage)image,rescaleOp,0,0); g2d.drawImage(image,rescaleOp,0,0);
} }
} }
} }