You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to insert an image into a Pixi canvas by using a base64 data URL string. I need to use that because the image is getting created from a camera feed (video tag).
Current Behavior
It works if I insert a regular image URL into the first argument of Sprite.from, but not when I use a base64 data URL.
here is the solution for anyone who finds this thread:
// img tag points to base64 URL
const image = document.querySelector('img')
const base = new PIXI.BaseTexture(image);
const texture = new PIXI.Texture(base);
const sprite = new PIXI.Sprite(texture);
Expected Behavior
I'm attempting to insert an image into a Pixi canvas by using a base64 data URL string. I need to use that because the image is getting created from a camera feed (video tag).
Current Behavior
It works if I insert a regular image URL into the first argument of
Sprite.from
, but not when I use a base64 data URL.Ex: https://codepen.io/gigamesh/pen/GRRzdrL?editors=1111
Is what I'm attempting even possible? If so, how?
Environment
pixi.js
version: 5.1.2The text was updated successfully, but these errors were encountered: