Apparently, getRGB
and setRGB
were not being used correctly.
I changed the code to:
oriImage.getRGB(0, 0, oriImage.getWidth(),oriImage.getHeight(), oriImageAsIntArray, 0, oriImage.getWidth());
(...)
bfImage.setRGB(0,0,bfImage.getWidth(),bfImage.getHeight(),oriImageAsIntArray, 0, bfImage.getWidth());
... and the picture displayed correctly. I still do not understand what this last argument is. In the JavaDoc, it is described as:
scansize - scanline stride for the rgbArray