+5 votes

Right now I have to save my rawarray(image) first but I want to show it without saving to the drive.

var image_as_raw_array = []#is filled with an png image from www
var path = "res://cache.png"

if(f.open( path, File.WRITE )==0):
    f.store_buffer( image_as_raw_array )

    var img = ImageTexture.new()
    img.load( path )

    preview_sprite.set_texture( img )

Is there a way without "img.load( path )" something like img.load( rawarray )?

in Engine by (176 points)
edited by

1 Answer

0 votes

I know it's about time.

If you only want to draw it, then you will still have to store it somewhere on disk. first draw the image, and then delete this file from the temporary folder that you previously created.

by (148 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.