Canvas is cool! - page 95

 
Petr Zharuk #:

Is onTimer() in onTimer()? If yes, what Event in milliseconds is set?

I have a multi timer system there:

But typically 30 milliseconds to render an animation.

In this example, there are a total of 6 Canvas objects. 4 objects for menus and two for charts
Most of the graphics output is done without a timer, but at some points it is included.
 
Nikolai Semko #:
Just a demonstration of Canvas capabilities.
Video is not accelerated, everything works without lags.
OpenCL and DirectX were not used.
If you use OpenCL, the processor will not be loaded at all.
But even with the use of a simple processor the time of formation of one frame is on average 5 -15 milliseconds.


.
Very beautiful
 
Nikolai Semko #:
I have a multi timer system there:

But typically 30 milliseconds to render an animation.

This example has a total of 6 Canvas objects. 4 objects for menus and two for charts
Most of the graphics output is done without a timer, but at some points it is included.

How do I overcome Canvas render freezing when I rewind the chart using the mouse-click method? Mine doesn't render until I release the mouse.

 
Petr Zharuk #:

How to overcome freezing of Canvas rendering when rewinding the chart by mouse-clicking? I don't get it to render until I release the mouse.

This is a problem with the choice of event for redrawing Canvas.
When scrolling the main chart, you can use two events CHARTEVENT_CHART_CHANGE or CHARTEVENT_MOUSE_MOVE (if the mouse button is pressed).
For example, look at this example.
If we are talking about MT4, you may need to use a timer for redrawing, and in OnChartEvent() set only permissive bool marks. Because in MT4 there is a glitch in the event model that leads to lags.
In general, it would be good to accompany your questions about problems with minimal code that reproduces these problems. There would be no need to make guesses and assumptions.

 
Nikolai Semko #:

These are problems with the choice of event for redrawing Canvas.
When scrolling the main chart, you can use two events CHARTEVENT_CHART_CHANGE or CHARTEVENT_MOUSE_MOVE (if the mouse button is pressed).
For example, see this example.
If we are talking about MT4, you may need to use a timer for redrawing, and in OnChartEvent() set only permissive bool marks. Because in MT4 there is a glitch in the event model that leads to lags.
In general, it would be good to accompany your questions about problems with minimal code that reproduces these problems. There would be no need to make guesses and assumptions.

Working with events helped to solve my problem.

Thank you!

Reason: