Hello All,
I am having a problem with the quality of my images.
What I am doing is getting a gif image from the jar file, putting it into a
BufferedImage, and then using TexturePaint to place it into a Java2D
rectangle.
In the process I lose some quality in the image (i.e., the image looks fuzzy
(especially around the edges)).
Any ideas
Here is the code snipet that gets the image, puts it into a BufferedImage,
and uses TexturePaint:
Image actualImage =
MMMapUtilities.getImageFromJar(this.getImageForKO());
BufferedImage bi = new BufferedImage(32,31,
BufferedImage.TYPE_INT_RGB);
Graphics2D big = bi.createGraphics();
// Render into the BufferedImage graphics to create the texture
big.drawImage(actualImage, 0,0,null);
// Create a texture paint from the buffered image
TexturePaint tp = new TexturePaint(bi, rect);
// Add the texture paint to the graphics context.
g.setPaint(tp);
// Create and render a rectangle filled with the texture
double x = this.getAnchorPoint().x;
double y = this.getAnchorPoint().y;
g.drawImage(bi,
(int)x,(int)y,(int)MMConstants.WIDTH,(int)MMConstants.HEIGHT,null);
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 2D Home Page: http://java.sun.com/products/java-media/2D/