# \[SOLVED\] Load a texture using base64 data string

**URL:** <https://forum.playcanvas.com/t/solved-load-a-texture-using-base64-data-string/9005>\
**Category:** Help & Support\
**Created:** [January 22, 2019, 10:13am UTC](https://forum.playcanvas.com/t/solved-load-a-texture-using-base64-data-string/9005 "2019-01-22T10:13:37Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Leonidas](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/leonidas/32/6495_2.png) [@Leonidas](https://forum.playcanvas.com/u/Leonidas)\
**Post date:** [January 22, 2019, 10:41am UTC](https://forum.playcanvas.com/t/solved-load-a-texture-using-base64-data-string/9005/2 "2019-01-22T10:41:11Z")

</div>

Check this, it doesn’t provide a code sample but the logic is sound and I can confirm it is working:

> [@\[SOLVED\] Dynamically creating texture assets from canvas/base64 resource](https://forum.playcanvas.com/t/solved-dynamically-creating-texture-assets-from-canvas-base64-resource/4629/5):
>
> Probably something like this would work: var texture = ...; // your texture object var asset = new pc.Asset("asset-name", "texture", { url: "", // not sure exactly what you want to put in here, empty string might be fine }); asset.resource = texture; asset.loaded = true; this.app.assets.add(asset);

- You need to download your image and create a pc.Texture. Here is a sample on how to manually create a pc.Texture from a remote source (it uses a video source, but using an Img element would be the same):  
[https://developer.playcanvas.com/en/tutorials/video-textures/](https://developer.playcanvas.com/en/tutorials/video-textures/)

- Then create manually a pc.Asset of type “texture” and assign your custom pc.Texture to it.

---

_[View the full topic](https://forum.playcanvas.com/t/solved-load-a-texture-using-base64-data-string/9005)._
