I read the Java doc and ImageIO does not return an accelerated image under 1.5.
Regardless I wanted to do it myself and found a nice way of doing so.
BufferedImage img = ImageIO.read(new File(path));
img = img.getSubimage(x, y, w, h);
BufferedImage tmp = new BufferedImage(
img.getWidth(),
img.getHeight(),
img.getType()
);
//get pixels from img and put into accelerated image called tmp
for(int yy=0; yy < tmp.getWidth(); yy++){
for(int xx=0; xx < tmp.getWidth(); xx++){
tmp.setRGB(xx, yy, img.getRGB(xx, yy));
}
}
EDIT:
Funny how I didn’t see these methods before.
“tmp.setRGB(xx, yy, img.getRGB(xx, yy));”
I was creating sub images like this under .NET’s GDI+.