Experimental
Advanced
Options for creating an ElementImageSource.
import { ElementImageSource } from 'pixi.js/html-source';// Manual lifetime (default): you call snapshot.close() yourself.const source = new ElementImageSource({ resource: snapshot });// Let the source close the snapshot for you when it is destroyed.const owned = new ElementImageSource({ resource: snapshot, autoClose: true }); Copy
import { ElementImageSource } from 'pixi.js/html-source';// Manual lifetime (default): you call snapshot.close() yourself.const source = new ElementImageSource({ resource: snapshot });// Let the source close the snapshot for you when it is destroyed.const owned = new ElementImageSource({ resource: snapshot, autoClose: true });
ElementImageSource For the texture source these options configure
Optional
Call ElementImage.close on the snapshot when this source is destroyed. Leave false when the same snapshot is shared with other sources or reused later, otherwise you risk a use-after-free.
false
false Copy
const source = new ElementImageSource({ resource: snapshot, autoClose: true });source.destroy(); // snapshot.close() is called for you Copy
const source = new ElementImageSource({ resource: snapshot, autoClose: true });source.destroy(); // snapshot.close() is called for you
Options for creating an ElementImageSource.
Example
See
ElementImageSource For the texture source these options configure