Libraries: Easy Canvas - page 6

 
Алексей Тарабанов:

Have the causes of the blinking been identified?

What blinking?

I don't have any blinking.

 
Yeah, I don't.
 
Nikolai Semko:

what blink?

I don't have any blinking.

I think it's line 349, recreate canvas, which is commented out now
 

Tested the library - convenient and functional!

two questions:

1. is there a ready implementation of a segment ending with an arrow? (there are examples under C++ http://www.cyberforum.ru/qt/thread1534114.html it is not a problem to port, but maybe there is a ready-made one and I didn't find it ;) )

2. changing the chart just clears the whole canvas? - if yes, it's very inconvenient, if not - I haven't figured it out, I need an example

 
Oleksii Chepurnyi:
I think it's line 349, recreate canvas, which is now commented out

I fixed that when I found that it was causing a freeze. But there was no blinking, just iCanvas stopped working.

 
new version 1.35.
Fixed a small bug in version 1.34 that caused the sine example not to work.
 
Igor Makanu:

Tested the library - convenient and functional!

two questions:

1. is there a ready implementation of a segment ending with an arrow? (there are examples under C++ http://www.cyberforum.ru/qt/thread1534114.html it is not a problem to port, but maybe there is a ready-made one and I didn't find it ;)) )

2. changing the chart just clears the whole canvas? - if yes, it's very inconvenient, if not - I haven't figured it out, I need an example

Thanks, Igor.

1. No, I haven't implemented it yet. With unsmoothed lines it is quite easy to do it. There are a lot of things I haven't implemented, and a lot of things I haven't posted yet.

2. No, of course not. Why do it. In my programs, when I change the chart, I forcibly redraw everything when the coordinates are tied to time and price, not to screen pixels. How could it be otherwise when price-time changes coordinates.....

Actually, the main beauty of this library is its speed.
If you try to do everything I do in iCanvas in CCanvas, the speed will drop significantly.
The main reason is that you will have to use terribly slow asynchronous functions, such as ChartXYToTimePrice(), which takes about 5000 microseconds. That's an incredibly long time.

The main goal of iCanvas was just to get away from these very expensive functions.

https://www.mql5.com/ru/forum/1111/page2099#comment_6310826

Ошибки, баги, вопросы
Ошибки, баги, вопросы
  • 2018.01.06
  • www.mql5.com
Общее обсуждение: Ошибки, баги, вопросы
 

Please note that it is better not to use the Line function in CCanvas when the coordinates of two points are formed not guaranteed within the screen. There is a serious bug there.

#include <Canvas\iCanvas.mqh> //https://www.mql5.com/en/code/22164

void OnStart() {
   Canvas.Erase();
   ulong t=GetMicrosecondCount();
   Canvas.LineD(-2000000000.0,-2000000000.0,800.0,800.0,0xFF0000FF);
   t=GetMicrosecondCount()-t;
   Print("LineD's runtime is " + string(t)+" microseconds.");
   Canvas.Update();

   t=GetMicrosecondCount();
   Canvas.Line(-2000000000,-2000000000,800,800,0xFFFF0000);
   t=GetMicrosecondCount()-t;
   Print("Line Run Time - " + string(t)+" microseconds.");
   Canvas.Update();
   Sleep(3000);
}

result of execution:

2020.02.07 19:08:28.030 TestLine (EURUSD,M1)    Время выполнения LineD - 4       микросекунд
2020.02.07 19:08:29.381 TestLine (EURUSD,M1)    Время выполнения Line  - 1349411 микросекунд
 
3D Moving Average
3D Moving Average
  • www.mql5.com
CSetFileReader Class to provide simple reading mechanism from MetaTrader set files. Trade Copier - Open Source - Multiplatform - Transmitter Side Trade Transmitter will Transmit Trades from MT5 Demo or Real accounts using CSV Files. Each trade request created manually or by other EAs on MT5 terminal will be...
Files:
iCanvas.mqh  45 kb
 
Nikolai Semko:

I fixed this when I found that there was a freeze happening because of this. But there was no blinking, just iCanvas stopped working.

Maybe it was different in different situations ) I was recreating the canvas and it looked like blinking. I wanted to pay attention to that line but didn't have time )