Results 1 to 2 of 2
  1. #1
    ErdyMurphy is offline Member
    Join Date
    Apr 2011
    Rep Power

    Default Buffered Image and DataBuffer


    i am working with the DataBuffer from an BufferedImage to
    have a perfomance advantage instead of using setRGB and getRGB...
    But I have the Problem that the BufferedImage and my DataBuffer isnt always
    synchron. I cam changing some pixels in my pixel Array and when
    i save the image as tif file i get not the current image with the pixels in the array...

    int [] pixel = ((DataBufferInt)img.getRaster().getDataBuffer()).g etData();

    is there a way to synchronize the BufferedImage and the DataBuffer?

  2. #2
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Rep Power


    After you modify the DataBuffer, try calling "setDataElements" with the Raster you obtained the DataBuffer from.

Similar Threads

  1. Volatile image vs buffered image
    By trishtren in forum Java 2D
    Replies: 0
    Last Post: 04-17-2011, 11:31 PM
  2. How can I make a buffered image solid?
    By rajkobie in forum AWT / Swing
    Replies: 2
    Last Post: 04-17-2011, 08:35 AM
  3. Drawing onto a buffered image
    By trishtren in forum Java 2D
    Replies: 3
    Last Post: 04-09-2011, 09:23 PM
  4. Rotating Buffered Image distorts image
    By VortexSpin in forum Java 2D
    Replies: 1
    Last Post: 02-13-2011, 06:54 AM
  5. adding a buffered image over a jpanel
    By fatmat9 in forum New To Java
    Replies: 1
    Last Post: 11-23-2010, 04:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts