With out code?
Yes because the code is the same line being executed over and over again.
Here is the line of code:
WindowScreenShot(filename,640,480);
The problem is not the code because I know it's the same line over and over again. The problem is that multiple screenshots over a quick succession of them do not work or something else, this is what im trying to figure out.
Well I think you have given your answer yourself: too many in a short time.
You can buy a new and faster pc or at least a fast SSD harddisk - I think anything else won't help.
That was just me guessing, i don't know if this is the case. How can i confirm that it is?
When you want to start taking screenshots, call EventSetTimer() or EventSetMillisecondTimer().
When you want to stop taking shots, call EventKillTimer()
In OnTimer(), add you code for taking screenshots.
Example: if you set EventSetTimer(1), a screenshot will be taken every second until you kill the timer.
That was just me guessing, i don't know if this is the case. How can i confirm that it is?
You can see how long it is blocked if you place right before and after your order WindowScreenShot(..) a GetTickCount():
//--- Remember the initial value uint click=GetTickCount(); WindowScreenShot(..) //--- Get the spent time in milliseconds click=GetTickCount()-click; Print("Blocked: ",(string)click," mSec");
When you want to start taking screenshots, call EventSetTimer() or EventSetMillisecondTimer().
When you want to stop taking shots, call EventKillTimer()
In OnTimer(), add you code for taking screenshots.
Example: if you set EventSetTimer(1), a screenshot will be taken every second until you kill the timer.
So are you saying this? :
EventSetTimer(1); OnTimer() { WindowScreenShot(..) } EventKillTimer();
And then the screenshot would be taken once, and after it is the timer would be killed which would basically take a screenshot every 1 second?
OnCalc(...){ : static datetime sleepUntil=0; if(TimeCurrent() >= sleepUntil){ // Sleep time expired. sleepUntil = TimeCurrent() + SleepSeconds; // Reset. :
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
This seems to be a very odd problem but I have a line of code which takes a screenshot with a certain size. The image file always gets created but sometimes the file size is 0 an others its the full image. It's the same code that gets executed on the same mt4 instance so I can't figure out what would be creating the image with a file size of 0 and sometimes it working as expected.
Any ideas on how i can troubleshoot this or what the problem could be?