Download MetaTrader 5

ChartScreenShot() is saving the files as empty

To add comments, please log in or register
wilson_wilson
134
wilson_wilson  

hi there

‌‌I am noticing that ChartScreenShot() is saving the files as empty (i.e. zero byte files), anyone noticing a similar result ? ChartScreenShot () function returns true btw and I am using the latest build of 1052.

I am using the following code :

int OnStart(){

     long chartid;

     chartid=ChartOpen("EURUSD",PERIOD_H1);

     string file="picture.gif";

     Alert("screenshot =",ChartScreenShot(chartid,file,800,600));

     return(0);

}‌

t‌hanks

w‌ilson

Alain Verleyen
Moderator
33626
Alain Verleyen  

The new chart (ChartOpen) has no time to be opened yet. Add a Sleep(10) or something.

wilson_wilson
134
wilson_wilson  
Alain Verleyen:

The new chart (ChartOpen) has no time to be opened yet. Add a Sleep(10) or something.



Ive tried Sleep(5000) after opening chart and it still does not work :(
honest_knave
Moderator
2296
honest_knave  
wilson_wilson:

Ive tried Sleep(5000) after opening chart and it still does not work :(

That code works fine for me... is the chart opening as it should?
wilson_wilson
134
wilson_wilson  
honest_knave:

That code works fine for me... is the chart opening as it should?

Yes, the chart is opening as it should, btw I think I might know what the problem is ... the code seems to work if I use it on a windows platform but not when I use it on my mac !
To add comments, please log in or register