Canvas is cool! - page 39

 
Ilyas:

GIF and PNG readers were already here https://www.mql5.com/ru/forum/92113#comment_2672596

Judging by its functionality, it is an "unpacker" of the format. Designed to read data from a .gif file. To complete the porting, you need to add playback functionality to MQL using Ccanvas class.

ZS. Reader after all.

 
Dmitry Fedoseev:

...

Are you the author of the ported reader?
 
no
 
Dmitry Fedoseev:
no
If you know Zorro, tell him he's good and let him try to finish porting by writing a replay algorithm in MQL. It will be hard for him from the 19th century, but let him try.)
 
Реter Konow:

Especially for Peter :) didn't get lazy!


Files:
show_gif.ex5  2989 kb
 
Yury Kulikov:

Especially for Peter :) didn't get lazy!


Thanks. It's not a brute-force overrun of .bmp frames compressed with the #resource command, is it? ))) Definitely not. It's a natural, rewritten in a couple of hours gif-file playback adapter on MQL-canvas, based on the ported .gif-reader. I must look like an idiot from the outside)))

Yuri, thanks for the demo, but anyone can do such a thing. Easy.

  1. Take a simple gif. Record it on video.
  2. Get all its frames from video.
  3. Save frames in .bmp format, numbered.

  4. Integrate frames to the script via #resource.

  5. Loop through the frames and display them one by one on canvas in endless loop.

As a result, we get a pseudo-gif that has no relation to standard gif-format representation in MQL-programs.

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

Added:

I will say that I also have a "pseudo-gif", but the technology is much more complex. It has author compression and a playback mechanism. And most importantly, the "pseudo-gifs" are bound to their elements and are reproduced from a common array. Compression is better than via the #resource directive, because unchanging colours are not written from frame to frame.


 
Yury Kulikov:

Especially for Peter :) didn't get lazy!


Yuri, you're a class act. Get involved in developing a solution for standard gifs on MKL.
 
Реter Konow:

You must be measuring people by your own standards.

There's a gif in the resources in the script, which I copied from Nikolai's post.

Maybe try another script, where the gif file is specified in the script parameters, the file should be in the Files folder.

Files:
 
Ilyas:

GIF and PNG readers were already here https://www.mql5.com/ru/forum/92113#comment_2672596

Yay, Thanks!
Time saved is time earned.

 
Реter Konow:

It's a fiasco, bro!