Results 1 to 2 of 2
Thread: saving an image
- 12-25-2010, 09:13 AM #1Member
- Join Date
- Dec 2010
- Rep Power
saving an image
I'm using JFileChooser to save an image, using the showSaveDialog. My problem is that I can't use ImageIO.write as I'm not using buffered image but instead I'm using ImageIcon, stuffed in a label and displayed using JInternalFrame. Is there any other methods to save an ImageIcon other than using ImageIO.write and casting my ImageIcon to RenderedImage like that (RenderedImage)myFrame.getImage() in the ImageIO.write function???
- 12-25-2010, 10:08 AM #2I'm using JFileChooser to save an image
I can't use ImageIO.write as I'm not using buffered image but instead I'm using ImageIcon
2. Get the Image form the ImageIcon and paint it to a newly created BufferedImage of the same size and appropriate type. Than save the BufferedImage.
casting my ImageIcon to RenderedImage like that (RenderedImage)myFrame.getImage()
To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.
- By LankanSniper in forum Java 2DReplies: 4Last Post: 11-07-2009, 04:48 AM
- By dudejonne in forum New To JavaReplies: 5Last Post: 11-03-2009, 02:01 PM
- By Goseph in forum Java 2DReplies: 2Last Post: 12-21-2008, 07:36 PM
- By Sysem in forum New To JavaReplies: 10Last Post: 06-02-2008, 06:29 PM
- By archanajathan in forum Advanced JavaReplies: 0Last Post: 01-08-2008, 05:29 PM