Java copying buffered Image perfomance issue?

It might interest you to hear that I could not really solve the problem. Instead I canceled the last zoom-step, limiting the biggest buffer to a size of 2000x2000 and eliminating the worst part of the problem. The zooming now goes quite smoothly (i measured 80ms for the first drawImage call.

Thats still quite a lot, but since the view changes rapidly you don't really notice it).

It might interest you to hear that I could not really solve the problem. Instead I canceled the last zoom-step, limiting the biggest buffer to a size of 2000x2000 and eliminating the worst part of the problem. The zooming now goes quite smoothly (i measured 80ms for the first drawImage call.

Thats still quite a lot, but since the view changes rapidly you don't really notice it). In my research I also found out that I could not explicitly force java to create accelerated VolatileImages of the requiered size. That might have been the problem - god knows why.

I still would like to find out though... But to give ppl with likewise problems one final word of advice: circumnavigate. Thanks for your help!

Don't know if it will help you, but my app copy slightly faster with System.arraycopy(). BufferedImage tmp = (BufferedImage) img; int src = ((DataBufferInt) tmp.getRaster().getDataBuffer()).getData(); int dst = ((DataBufferInt) bi.getRaster().getDataBuffer()).getData(); System. Arraycopy(src, 0, dst, 0, dst.

Length).

Not a bad idea. Arraycopy usually has the best performance for this stuff. But I'm not certain the asker requires making copies of his image.

He needs to draw it out to a Graphics context. Maybe there's some way of copying over to a pixel buffer? – G_H Nov 1 at 0:37 the idea is good.

Cant get faster then that (besides actually using the graphic card). But: im trying to draw on a strategie-buffer, meaning I pretty much only have the Graphics2D-Object. So no Raster... Is there a way to explicitly tell java that I don't want any resizing?

Since my image-copying really should take place pixel by pixel. – julian Nov 1 at 8:09.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions