Hello all

As stated in Sun's javadoc, java.awt.image.RenderedImage.getData() performs a 
*copy* of the data. So it is not surprising if OutOfMemoryError occur for big 
images.

Use iterators as suggested by Mickael. But you need to do it that way:

RectIter iter = ....
if (!iter.finishedBands()) do {
     iter.startLines();
     if (!iter.finishedLines()) do {
         iter.startPixels();
         if (!iter.finishedPixel()) do {
             // Do your process here.
         } while (!iter.nextPixelDone());
     } while (!iter.nextLineDone());
} while (!iter.nextBandDone());



        Martin

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to