Falk Joensson's
Eas (Easy Application Script)

Rendering 2D Drawings:03. Display the Drawing

DRAW'TO:p w 0 h 0 renders the drawing described by all prior DRAW'... calls to either the existing picture <canvas> element, or as a new <canvas> element replacing a loaded <img> or <video> given by the E DHT Element Key p (will do nothing if they're not yet loaded) using the width and height of them by default using them as the base for drawing or to apply image efffects to (subsequent calls, eg to apply effects to a video in a timer event, will re-use this assignment) or as a new <canvas> element under the parent element given by the E DHT Element Key p with the width w and the height h, both in whole pixels and resets the DRAW'... module (the next call creates a new drawing) if the absolute value of w is greater than 1, the <canvas> will get this width if -1≤w≤1 (typically 0), the width will be left unchanged for an existing <canvas>, or set to 500 for a new <canvas> if the absolute value of h is greater than 1, the <canvas> will get this height if -1≤h≤1 (typically 0), the height will be left unchanged for an existing <canvas>, or set to the width for a new square <canvas> if either w or h are 1 >1 ("enforce dimension"), the <canvas> will be cleared to redraw anew, otherwise ("request or keep dimension") only if either dimnesion changes by request examples for w: 500 = enforce a width of 500 pixels, redraw -500 = request a width of 500 pixels, redraw only if this changes the width 0 = keep the current width, do not redraw (unless the height changes or is enforced) the function returns an array: .k the E DHT Element Key of the <canvas> .w the resulting width of the <canvas> .h the resulting height of the <canvas> .t the rendering time taken in milliseconds
03. Display the Drawing
D Download Eas 4B
O Donate
C Contact
Esc Search / Table of Contents