Is it possible (or is there a technique) to get an image.ondata event client side for a DOM Image Element? Aka, something similar to the onload.
Question context
Standard ‘jpeg’s render into a browser Image Element from top to bottom, pixel row at a time. It would be fun to play with this: animate the swiped down; draw in blocks at time.
Possible solution
Grab a base64 or binary data from the server and render on a Canvas Element. Any other ideas? Anyone does this before*?
*yeah that is cheating, but if you’ve done it already it would save me reinventing a wheel.
I know of no way to do custom progressive rendering of an image as the image data arrives. What you can do is have the image not displaying, wait for the entire image to be loaded (via
onloadevent) and then do custom reveal of the image.That custom reveal can be done a number of ways like many of the javascript/CSS based slideshows available for the browser.