Canvas is cool! - page 31

 
Nikolai Semko:

Thanks, Andrey :)

I will explain, Andrew, my logical reasoning to your question "is it possible to save in video?".
Before answering any question, I try to understand, by available means, who is asking the question and his level. In order, firstly, to build my answer more correctly and understandably, and, secondly, to understand the meaning of a very vague question, so as not to answer a question with a question.
Clearly - I went to your profile.
  • If I had seen a rating of say 162 there and had been on the forum for 2-5 months, I would have understood that the question is being asked by a newbie.
And I would have answered simply: "At the moment, video saving is not implemented in MT5, but it can be done if you want".
  • But I remember that your name came up frequently on the forum and from your profile, I realized that I'm dealing with an experienced programmer, who has been on the forum for more than 10 years, who is 5 times larger than me in number of posts and has at least one article, 5 completed jobs and three QB codes in his arsenal, and his rating is higher than mine by more than 2 times.
So you, I thought, are very well versed in MT5 features and know the documentation as well as I do and I conclude that your question is about the potential ability to save video and you are interested in my opinion, as I kind of know my way around Canvas.
That's why I started answering you in the format of potential capability.
  • Or maybe you are just another smart ass and someone who likes to make fun of others like "Your brooms can fly".

I don't really care about the banterers though, as a rule they are people who think they are very smart, but in fact they are very smart and clumsy. Usually they just need some psychological aikido trick and then they collapse in a great panic.


ZS And as for the moon, your answer NO made me smile. Know this, it is your correct answer. My "wrong" answer to such a question will again be different depending on who is asking me the question.



You can philosophize a lot and for a very long time, but the meaning of the question was on the surface and was immediately, clearly and unambiguously. And in response to that question to say something about video recording from the screen... is something))) if you're so fond of speculating about levels. What does MT5 documentation have to do with it?

 
Dmitry Fedoseev:

And you know, here a hundred years ago, Zorro demonstrated the playback of an animated gif through a canvas. Not some obscure looped video sequence, but a simple animated gif.

I didn't know that. You have to figure out the format of the gif and dissect it and form the frames. I don't think it's very difficult. But then you can easily record standard bends too, if you understand the format.
 
Nikolai Semko:
I didn't. You have to figure out the gif format and dissect it and form the frames. I don't think it's very difficult. But then you can easily record standard bends too, if you understand the format.

It's as easy as avi if it's uncompressed. Neither is difficult, you just need to know how, but so far no one knows. I think there's a better chance of figuring it out with a gif.

It's better to pay attention tothis advice. Because even if you can figure out how to create an uncompressed video, you won't get very far, the file sizes will be too huge.

 
Nikolai Semko:
Why do you think so?

Judging by the answer.

 
When I think of video, I think of the algorithm for compressing it, i.e. codecs, otherwise it's child's play
 

There is another option, and it is probably the most interesting and useful. Win API: AVIFileOpen(), AVIFileCreateStream(), etc.

 
Nikolai Semko:

First experiments with the dynamic timeframe.

EURUSD all history in dynamics:

.

Fractality is evident.

norms

below the slat to select the window and the scale


 
Nikolai Semko:

Thanks, Andrew :)

I will explain, Andrew, my logical reasoning to your question "is it possible to save in video?".
Before answering any question, I try to understand, by available means, who is asking the question and his level. In order, firstly, to build my answer more correctly and understandably, and, secondly, to understand the meaning of a very vague question, so as not to answer a question with a question.
Clearly - I went to your profile.
  • If I had seen a rating of say 162 there and had been on the forum for 2-5 months, I would have understood that the question is asked by a newbie.
And I would have answered simply: "At the moment, video saving is not implemented in MT5, but it can be done if you want".
  • But I remember that your name came up frequently on the forum and from your profile, I realized that I'm dealing with an experienced programmer, who has been on the forum for more than 10 years, who is 5 times larger than me in number of posts and has at least one article, 5 completed jobs and three QB codes in his arsenal, and his rating is higher than mine by more than 2 times.
So you, I thought, are very well versed in MT5 features and know the documentation as well as I do and I conclude that your question is about the potential ability to save video and you are interested in my opinion, as I kind of know my way around Canvas.
That's why I started answering you in the format of potential capability.
  • Or you are just another clever fellow and someone who likes to make fun of others like "your brooms can fly".

But the banterers don't bother me much, because as a rule they are people who consider themselves to be very clever, but in fact they are very unintelligent and clumsy, against whom, as a rule, a slight psychological aikido trick is enough and they collapse in general laughter.


ZS And as for the moon, your answer NO made me smile. Know this, it is your correct answer. My 'wrong' answer to such a question will again be different depending on who is asking me the question.



 
Nikolai Semko:

...
How do you assemble the frames?
I don't understand how you capture code from ME.
If it's even just through screenshots, well done anyway, as I can see they're packed.
Your work deserves attention.

ZS The thread though I created it and somehow historically it's more of a running thread as kanvas is something of a hobby and an outlet for me.
But I don't feel like I'm the boss here or that it's some kind of private territory. The doors are open. Everyone is welcome. All are welcome. And even trolls, for they sometimes give you a drive. :)

Thank you, Nicholas.

//------------------------------

Training:

1. I gather frames in a simple editor "FastStone", making screenshots of the desired area, or shoot a clip with Camtasia, and transfer the frames to FastStone.

2. I process the frames (add shadows, arrows, texts) and save them in .bmp format in Images\MyGif folder (each gif has its own subfolder).

3. The names of the frames should be "1.bmp", "2.bmp", "3.bmp", ... It is necessary for the script, which creates the Gif.

4. Open the script in ME and integrate all the frames through #resource.

//-------------------------------

Principle of the script:

1. The script loops through the frames and reads them through the ReasourceReadImage.

2. The script loads two frames at once - new and previous: 1 and 2, then 2 and 3, then 3 and 4.... And it compares pixel colours in the new frame and the previous one. If the colour has changed, the script writes the pixel number and its new colour into an array. Thus, only pixels and colours that have changed since the previous frame are written. If a pixel's colour doesn't change after the first frame, the pixel with that colour will be written once. This is the first compression mechanism.

3. The second compression mechanism: rows of pixels with the same colour are shortened. If the pixel row has a colour that repeats from pixel to pixel, the script starts a cycle of counting repetitions and writes to the array the number of the starting pixel (from which the sequence of repetitions began, the colour and number of repetitions).

This way, the script compresses the frames and packs the gif. At the end of the cycles, the collected array is written to the file with the name of the gif, after which the constructor loads it by reading the kib-code. The interface may contain any number of hyphae, but each hyphae is assigned to its own element and its beginning in the array, written in the element properties in the graph.kernel.

//--------------------------------

Mechanism of hyphae reproduction:

1. Each hyph has several properties: origin in an array of hyphae, number of frames, frame size, pause between frames.

2. A special block cycles through the kernel objects and searches for the property of the gif. The block checks:

  • Presence of the hyphae in the element.
  • Whether the item is visible or hidden
  • Whether the item is visible

If the checks are passed, the block accesses the array of hyphae at the address of the particular hyphae, looking at:

  • frame counter
  • pause counter

If these checks are passed, the unit proceeds to read the hyphae:

1. the unit loads the canvas on which the gif is drawn.

2. the unit reads the current frame and unpacks it:

  • Finds the right pixels by number and calculates their position in the overall kanvas.
  • Draws pixels of the right colour in the right place.
  • "Unpack" a sequence of pixels with the same colour.

The block moves not only through frames, counting the pause between them, but also through different hiffs of different elements in different windows, skipping those hiffs which are hidden behind the visibility area or in closed windows.

//--------------------------

That's the kind of work. Thought it was easy, but when I told it, I got a little "shocked" by the complexity :).

ZS. A gif with an image size of 800*600 is compressed up to 20 times or more. If I managed to write everything in a char array, the compression would increase another 4 times. But, it would definitely impoverish the colour palette.
 
But what does "gif" have to do with it?