Falk Joensson's
Eas (Easy Application Script)

Rendering 2D Drawings:19. Loading Images

DRAW'FROM:s uses the image from the source s given by the E DHT Element Key of a loaded <img>, <canvas> or <video> as the new starting point for the drawing, setting the drawing's width and height to the dimensions of the source, but never larger than the viewport DRAW'FROM:s r the image can be resized by r either to 10≤r≤1000 % or to fit a desired pixels range for both width and height combined or for either individually given as a string \d*-\d* in the former case and \d*-\d*[^\d-]+\d*-\d* in the latter omitted limits or such set to 0 are ignored examples: "100-300" at least 100, at most 300 "500-" at least 500 "-800" at most 800 "80-240 50-150" width 80-240, height 50-150 DRAW'COPY:k places the image from the source given by the E DHT Element Key k of a loaded <img>, <canvas> or <video> onto the drawing like a sticker sized to fit exactly in the coordinate system's box placed with its center at 0,0 DRAW'COPY:k x 0 y 0 w 1 h 1 s 0 a 100 places the image centered at the point given by x and y in the current coordinate system's format the width scaled by the factor w 1 = fit the image into the coordinate system's box 0.5 = the image is half as big as with 1 -1 = ditto, but mirror horizontally 0 = (special case) let the image cover all the box
the height scaled out of proportion by h 1 = keep the image's aspect ratio 0.5 = make the image half as high 3 = make the image thrice as high a negative h vertically mirrors the image rotated by the spin angle s in clockwise degrees using an alpha (opacity) of a percent DRAW'COPY:k r x y ... before x,y you can use a relativeness prefix, see the last option under S Drawing Shapes DRAW'COPY:k x y p ... after x,y you can change the image position by p p is a string /^([lcr][tmb]?|[tmb][lcr]?)$/i l = x is the left edge of the image c = x marks the horizontal center of the image r = x is the right edge of the image t = y is the top edge of the image m = y marks the vertical middle of the image b = y is the bottom edge of the image
19. Loading Images
D Download Eas 4B
O Donate
C Contact
Esc Search / Table of Contents