Static p5_sys::global::createImg[][src]

pub static createImg: CreateImgInternalType
Expand description

Creates an element in the DOM with given src and alternate text.

Examples

createImg(
  'https://p5js.org/assets/img/asterisk-01.png',
  'the p5 magenta asterisk'
);

Overloads

src src path or url for image

alt alternate text to be used if image does not load. You can use also an empty string (“”) if that an image is not intended to be viewed.


src src path or url for image

alt alternate text to be used if image does not load. You can use also an empty string (“”) if that an image is not intended to be viewed.

crossOrigin crossOrigin property of the img element; use either ‘anonymous’ or ‘use-credentials’ to retrieve the image with cross-origin access (for later use with canvas. if an empty string(“”) is passed, CORS is not used

successCallback? callback to be called once image data is loaded with the p5.Element as argument