Thursday, July 2, 2015

The img Tag

This is my latest test in recycling data.
Firstly notice the style declaration in the tag. This enlarges the image from 256 x 256 to 512 x 512.
Because the timer is continually running you have to get notified when the src is changed. In a real world application the images onload event will replace the button and onclick event.
The timer is simple to implement and the 50 stands for 50 milliseconds. 1000 / 50 = 20 ticks per second.
 Running the file on firefox gives us this output. On chrome it won't work, the image must be in a domain. Pressing the button at anytime produces this output.

On the server-side all the images are PNG files and compressed. On the client-side the RAM usage remains the same. Recycling the same memory and not creating more memory and overheads.

No comments:

Post a Comment