Save graphic as picture

I need to save a graphic (Multichart Object) as a JPG file. Can you help me ?

Here's the method used in JFreeChart:
    public static void writeChartAsJPEG(OutputStream out, JFreeChart chart, int width, int height)
        throws IOException {
        BufferedImage image = chart.createBufferedImage(width, height);
        JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
        JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(image);
        param.setQuality(1.0f, true);
        encoder.encode(image, param);
    }This approach ought to work for any BufferedImage...I don't recommend using JPEG for charts though, PNG will give you much better quality. Save JPEG for your photos...
JFreeChart is at: http://www.object-refinery.com/jfreechart/index.html
Regards,
Dave Gilbert
www.object-refinery.com

Similar Messages

  • How can i save music and pictures so all users can access them?

    how can i save music and pictures so all users can access them?

    Hi, this should be your answer as for sharing music. For photos though, I would assume you can do the same thing. Hope it helps!
    http://support.apple.com/kb/ht1203

  • TS1702 One of my apps is called Shelf Wallpaper and in this App there are Icon wallpapers and it says VIP Only on them so when i press save on a wallpaper i like in this section it says: Please upgrade through in app purchase to save all vip Pictures how

    One of my apps is called Shelf Wallpaper and in these wallpapers there are Icon wallpapers and it says VIP Only on them so when i press save on a wallpaper i like in this section it says: Please upgrade through in app purchase to view and save all vip Pictures and then a button comes with Upgrade or cancel on it so naturally i press upgrade but nothing happens.How do i get to download these wallpapers.?

    Well I figured out my problem lol
    Email a- original apple id email
    Email b- original gamecenter id
    Email c- the new gamecenter id
    Email d- the temporary email for switching stuff
    So originally I had Email a for apple id and icloud, and Email b for gamecenter. I wanted my gamecenter and apple id to be the same. Well today I went on my moms phone and saw that I was still on family sharing under Email d. That's when it hit me, your gamecenter, apple id, and icloud are the same account. By switching my gamecenter id to Email a, I turned that into my new apple id. Now my apple id is back to normal, and my gamecenter is Email c (I don't use Email b anymore so that's why I wanted to switch it).
    Basically, my problem was being stupid enough not to think that your gamecenter was connected to your apple id. My problem came from switching my gamecenter email. So that's how to avoid this, don't be an idiot and think your gamecenter is a whole different account. For anyone who ever has this problem, that's why it happened haha.

  • Is there a way to Quickly organize, consolidate & save the Original (Pictures, Movies, etc.) yet delete all duplicate (Pictures, Movies, etc.)?

    Is there a way to Quickly organize, consolidate & save the Original (Pictures, Movies, etc.) yet delete all duplicate (Pictures, Movies, etc.)?

    I wanted to first thank you for this, as this is the only workaround literature that seems to be floating around out there.  With that said, I know it is a big ask, but is there any way that you could create a video showing step by step how to do what you do?  I have several tracks that are stuck in waiting mode, and if left in itunes, will never upload or match...they only cause the upload process to hang up and restart.  I've tried leaving it for days...I've tried converting the files, signing in and out of itunes (and itunes match), updating itunes match, and I tried your technique...unfortunately to no avail.  Perhaps I didn't do your technique correctly.  I used audacity to reverse the audio.
    ANY help would be GREATLY APPRECIATED!!!
    Thanks

  • How can I apply drop shadow effects to graphics and pictures? It was very easy in previous versions and I can't find it. Thanks

    How can I apply drop shadow effects to graphics and pictures? It was very easy in previous versions of Final Cut and I can’t find it. Thanks

    Try this one, works marvelous:
    http://www.rippletraining.com/using-the-rt-drop-shadow-in-final-cut-pro-x.html
    Regards
    Nolan

  • Save a facebook picture to photo gallery

    does anyone know how to save a facebook picture to my picture gallery on the samsung galaxy?

    You could try something like this:
    https://play.google.com/store/apps/details?id=com.facebookphotossave&hl=en

  • How to add selection to 'save image to pictures' ?

    Hi guys,
    Doubt this is possible. Want to know if we can add the option to save to the pictures folder as well as the downloads folder when right clicking an image on the net.
    Thanks.

    The only way I know of to do that is to right click on the image, select "Save As..." which will open the Finder window, and there navigate to the your User folder's "Pictures" folder.  Not very elegant, I know.  You cannot easily add to the previous right click's list of options.

  • Why can't I save my entire picture as my background like before?

    Why can't I save my entire picture as my background like before?

    https://discussions.apple.com/thread/5318510?tstart=0

  • HT4623 how do i save all my pictures to my computer

    how do i save all my pictures to my computer

    You can import pics from your camera roll to your computer.  http://support.apple.com/kb/HT4083

  • Mountian lion won't save my deskotp picture

    Mountian lion won't save my deskotp picture, every time I restart It goes back to the defualt galaxy photo.
    What gives?

    Ditto here.  Same thing for any changes to the programs in the dock after a restart or log-off.  Very frustrating.
    -B
    iMac 2011, OS X 10.7.2

  • How can I permanently save received "sendpix" pictures?

    When I receive photos via sendpix I view them on Safari and have tried saving them to a Webarchive. However, after 30 days they expire and I'm losing the pictures! Is there any way I would be able to permanently save sendpix received pictures? As can be seen from my alias I am of an age that tends to be a bit technically challenged, so advice in layman's terms would be much appreciated! Thanks!

    Click and hold on them in Safari and drag them to the desktop, or press the Shift, Command, and 4 keys followed by dragging to enclose them, or print the page, click on PDF in the resulting dialog box, and create a PDF of it.
    (39246)

  • HT201302 my iphone 5 will not turn on. i want to save all my pictures and videos to my laptop but i cannot do it as my iphone will not switch on. how do i get them?

    my iphone 5 will not turn on. i want to save all my pictures and videos to my laptop but i cannot do it as my iphone will not switch on. how do i get them?

    A reset may help. Tap and hold the Home button and the On/Off buttons for approximately 10-15 seconds, until the Apple logo reappears. When the logo appears, release both buttons.
    No content is affected by this procedure.

  • Can't save or post pictures on Facebook since ios 6 update

    Can't save or post pictures on Facebook since ios 6 update...please help!  I have an iPhone 4.

    ok finally got the problem solved.  Hopefully this will help other people experiencing this problem. 
    First, go Settings, then select Phone.  Under "My number" it should say your current number.  If it doesn't (as it didn't in my case) call sprint (dial *2 on your phone).  Tell the sprint agent you would like your Name assigned to your number. 
    In my case, I had been added to an existing family plan.  I was assigned a random new cell phone number, but then later changed it to my old existing phone number from AT&T.  So if you are like me and brought your old cell phone number with you when you switched to Sprint, then this may be the issue. 
    When I was experiencing the problem with my pictures not sending, the wrong phone number was showing as my number on the phone (even though people could call and text me using my current number). 

  • HT201317 How to save a facebook picture

    How do I save a facebook picture to my Photo stream

    Save it to your camera roll by tapping and holding on the photo, then tapping Save Photo in the pop-up.  Once it's in the camera roll, it will be added to your photo stream.
    You'll have first to go to Settings>Privacy>Photos and turn Facebook to On in order to save FB photos to your camera roll.

  • My desktop is windows and I cant save my edited pictures from lightroom to my computer to upload to facebook - all there is is a picture of LR in place of the picture I did changes to

    my desktop is windows and I cant save my edited pictures from lightroom to my computer to upload to facebook - all there is is a picture of LR in place of the picture I did changes to - how do I do that?

    You need to export JPG copies of your adjusted photos to upload to FB.

Maybe you are looking for