This should be easy, but it turns out not to be.. I obtained the following code online which purports to get the content of the JFrame:
Then I write out the image with the following code:
When I double-click on the resulting file, all the images show up as black rectangles in Windows Photo Viewer. Yet the associated buffered image displays correctly in the window. What am I doing wrong or not doing? How may I fix this to work? I've tried 'jpg, 'png', and 'bmp' extensions, with matching formats in the write. I am using Win-7 64-bit. and jdk8 with matching jre.
Thanks for any help.
Then I write out the image with the following code:
When I double-click on the resulting file, all the images show up as black rectangles in Windows Photo Viewer. Yet the associated buffered image displays correctly in the window. What am I doing wrong or not doing? How may I fix this to work? I've tried 'jpg, 'png', and 'bmp' extensions, with matching formats in the write. I am using Win-7 64-bit. and jdk8 with matching jre.
Thanks for any help.