Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Save transparent buffered image

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a program where I allow a user to load multiple images, and then i save them to the file system, and then allow them to reload them into the viewer. that is working fine, but if a user loads a ping with transparent areas, it displays fine the first time it is loaded, but after the user saves their work and reloads it all the transparent areas are black. I am storing the images as buffered images, and am getting an array of pixels for the buffered image using the following to save the image.

int[] pixels = convertImage(bi);

and using the following to convert it back into a buffred image when the user loads the file:

int[] tempPixels = tempItem.getImage();
BufferedImage bi = createImage(tempPixels, tempItem.getSaveWidth(), tempItem.getSaveHeight());

any help on how to save the image and keep transparency would be greatly appreciated.

thanks,
reply
    Bookmark Topic Watch Topic
  • New Topic