25.22. CanvasRenderingContext2D.drawImage( ): draw an image25.22.1. Synopsisvoid drawImage(Image image, float x, float y) void drawImage(Image image, float x, float y, float width, float height) void drawImage(Image image, integer sourceX, integer sourceY, integer sourceWidth, integer sourceHeight, float destX, float destY, float destWidth, float destHeight) 25.22.1.1. Arguments
25.22.2. DescriptionThere are three variants of this method. The first copies the entire image to the canvas, placing its upper-left corner at the specified point and mapping each image pixel to one unit in the canvas coordinate system. The second variant also copies the entire image to the canvas but allows you to specify the desired width and height of the image in canvas units. The third variant is fully general: it allows you to specify any rectangular region of the image and copy it, with arbitrary scaling to any position within the canvas. The images passed to this method must be Image or Canvas objects. An Image object may represent an <img> tag in the document or an offscreen image created with the Image( ) constructor. 25.22.3. See AlsoImage |