aspose file tools
The moose likes Java in General and the fly likes Save transparent buffered image Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Save transparent buffered image" Watch "Save transparent buffered image" New topic
Author

Save transparent buffered image

Brandon Broschinsky
Ranch Hand

Joined: Aug 21, 2004
Posts: 41
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,
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Save transparent buffered image
 
Similar Threads
Render images from java code
Image to BufferedImage converter
Did older Java have problems with Transparent Images?
Displaying images and thumbnails directly from database
2D animation/transparency question