How to draw a rawarray Image

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By alexholly
:warning: Old Version Published before Godot 3 was released.

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 )
	f.close()

	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 )?

:bust_in_silhouette: Reply From: VarionDrakon

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.