Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

chart.getImage() bug - Screenshots shows things that are not on charts
 Post subject: chart.getImage() bug - Screenshots shows things that are not on charts Post rating: 0   New post Posted: Thu 19 Jul, 2018, 05:32 
User avatar

User rating: 7
Joined: Thu 05 Sep, 2013, 12:43
Posts: 56
Location: Russian Federation, Tomsk
Hello,
I use this code to save chart screenshot

    private void saveChartScreenShot(IChart chart, long time, double profit) {
        try {
            String dayMonth = new SimpleDateFormat("dd.MM.yyyy HHmmss").format(new Date(time));
            Instrument instrument = chart.getInstrument();
            String fileName = String.format("%s %s %.1f.png", dayMonth, instrument.name(), profit);
            File outputfile = new File(fileName);
            BufferedImage bufferedImage = chart.getImage();
            ImageIO.write(bufferedImage, "png", outputfile);
            print("%s screenshot saved as %s", instrument.toString(), outputfile.getAbsolutePath());
        } catch (IOException e) {
            console.getErr().println(e);
        }
    }


But sometimes screenshots shows things that are not on charts. They are "dirty" with some pieces that are just not there, look attached examples.
I try to add chart.repaint(); before call chart.getImage(); but no result.

example #1
Image

example #2
Image

example #3
Image

example #4
Image


Attachments:
18.07.2018 210446 GBPUSD -5.7.png [13.59 KiB]
Downloaded 276 times
18.07.2018 210352 USDJPY 4.0.png [20.77 KiB]
Downloaded 267 times
18.07.2018 141102 GBPUSD 2.9.png [10.63 KiB]
Downloaded 270 times
18.07.2018 121349 GBPUSD -3.5.png [12.39 KiB]
Downloaded 267 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: chart.getImage() bug - Screenshots shows things that are not on charts Post rating: 1   New post Posted: Fri 20 Jul, 2018, 15:47 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hello,

Thanks for your report. Problem was determined. Fix will be available in next platform release.


 

Jump to:  

cron
  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com