Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

role

[java] ImageIO

This topic is 5475 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

sorry for this crosspost, i have post this in JDC forum but don''t get the answer i use ImageIO.read for loading my images in application (window and fullscreen) it do well but in applet the images is blur somewhat and when loading PNG images (in applet) i got errors: javax.imageio.IIOException: Unknown row filter type (= 7)! at com.sun.imageio.plugins.png.PNGImageReader.decodePass(Unknown Source) at com.sun.imageio.plugins.png.PNGImageReader.decodeImage(Unknown Source) at com.sun.imageio.plugins.png.PNGImageReader.readImage(Unknown Source) at com.sun.imageio.plugins.png.PNGImageReader.read(Unknown Source) at javax.imageio.ImageIO.read(Unknown Source) ......... this is i use to load images:
    public static BufferedImage getImage(Class base, String imagefile, int transparency) {    try {        BufferedImage src = ImageIO.read(base.getResource(imagefile));        BufferedImage dst = gc.createCompatibleImage(src.getWidth(), src.getHeight(), transparency);        Graphics2D g2d = dst.createGraphics();        //g2d.setComposite(AlphaComposite.Src);        g2d.drawImage(src,0,0,null);        g2d.dispose();        return dst;    } catch(IOException e) { System.err.println(imagefile); e.printStackTrace(); return null; }    }
 
to be clear on what i mean see my game at http://www.mycgiserver.com/~goldenstudios/ click the mouse, for my 2nd game, the instruction images is messy thanxx to all

Share this post


Link to post
Share on other sites
Advertisement
just a shot in the dark...

1. maybe antialiasing is turned on
2. your png pic is maybe not encoded in a usual way. Try another picture encoded with classic parameters.

...however, like i said before, it''s just a shot in the dark.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!