Login Register

gfx createImage

Stretching an image

If you create an image using
iSurface.createImage({width: 350, height: 350, src: fileName});

where the surface has also been defined as having dimensions of 350 x 350

an image is drawn to fill the full area if it is square. If the image is oblong, say 40 x 256, it is drawn to
that smaller dimension, whereas

image.src=fileName;

will stretch the image to the full square area.
Is there a way to do this with createImage?

Syndicate content