aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Save Component(containing jpeg and JLabels) as JPEG?  Is there a package for this? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Save Component(containing jpeg and JLabels) as JPEG?  Is there a package for this?" Watch "Save Component(containing jpeg and JLabels) as JPEG?  Is there a package for this?" New topic
Author

Save Component(containing jpeg and JLabels) as JPEG? Is there a package for this?

Matt Wilcko
Ranch Hand

Joined: Sep 23, 2003
Posts: 65
Is it possible to save a Component(containing jpeg and JLabels) as a JPEG? Has anyone seen a package out there that allows this by simply passing the component?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8713
    
    6

Given a Component "this", one can create an image and write it to file by:


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Matt Wilcko
Ranch Hand

Joined: Sep 23, 2003
Posts: 65
Thanks Joe!
One more question, any idea if I can specify dpi? Ideally the image would be 300 dpi for high quality printing.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8713
    
    6

Why didn't you just post a new topic with a link to your
previous question
Brian Pipa
Ranch Hand

Joined: Sep 29, 2003
Posts: 299
I tied this a few years ago and could find NO way to get anything more than 72 DPI. I was using an image then using a PDF converison library to convert it to PDF. The output looked awful because it was 72 DPI. I gave up on the PDF/JPEG output. If anyone does know a way to make it greater than 72 DPI, I would be interested to hear it also.
brian


My Java Freeware:<br />MACCC - <a href="http://maccc.pipasoft.com" target="_blank" rel="nofollow">http://maccc.pipasoft.com</a><br />Nator - <a href="http://nator.pipasoft.com" target="_blank" rel="nofollow">http://nator.pipasoft.com</a>
Matt Wilcko
Ranch Hand

Joined: Sep 23, 2003
Posts: 65
Would it be possible to create a component that is larger than screen size(2000 x 1500 for example) and then make a jpeg from that with the method above?
It wouldnt be 300 dpi, but an image that large could be converted to a 6.5" x 3" 300 dpi image. Basically the same as a digital camera, a high rez 72 dpi image.
Just have the user work on a low rez version on-screen and then from that create the very large component and save it to jpeg.
Will this even work? Im just thinking out loud.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Save Component(containing jpeg and JLabels) as JPEG? Is there a package for this?
 
Similar Threads
B&S: Can we include Images in javadoc HTML documents?
How to create an image in Rational Rose ??
Java Code to Convert RTF to JPG
PDF to Image Converter
Can you specify a jpeg's dots-per-inch when saving a component as jpeg?