Hi guys, I've made a little movie out of BufferedImages and it runs beautifully, however, the problem I'm faced with is loading time.
By loading time, I mean the time it takes to craft this array list of BufferedImages.
By the way, the movie is just an image that fades in and out.
I have pinpointed the problem to be that whenever I create a new BufferedImage, it just takes way too much time for java to allocate that memory.
Here is a code snipit:
private BufferedImage setAlpha(byte alpha) { BufferedImage temp = null; alpha %= 0xff; try { temp = ImageIO.read(new File("images\\intro.png")); } catch (IOException e) {} for (int cx=112;cx<675;cx++) { for (int cy=8;cy<567;cy++) { if(temp != null){ int color = temp.getRGB(cx, cy); int mc = (alpha << 24) | 0x00ffffff; int newcolor = color & mc; temp.setRGB(cx, cy, newcolor); } } } return temp; }
temp = ImageIO.read(new File("images\\intro.png")); is the line that takes forever, does anyone have any suggestions?
Thank you,
Ludicrous