File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Matt Wilcko
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given a Component "this", one can create an image and write it to file by:
 
Matt Wilcko
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why didn't you just post a new topic with a link to your
previous question
 
Brian Pipa
Ranch Hand
Posts: 299
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Matt Wilcko
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic