dzosek I don't know if I asked the question right? I'm using this code, but I don't know how to display an image func _ready(): var myimage = preload("res://Untitled.jpg") var theimage = myimage.get_data() theimage.crop(600,600) theimage.lock() print(theimage. get_pixelv(Vector2(350,350)))
dzosek but it doesn't really work as if I wanted to var myimage = preload("res://Untitled.jpg").get_data() myimage.lock() myimage.set_pixel(35,35,color) $Sprite.set_texture(myimage) And after I've adjusted this code, I can't see the picture
SIsilicon28 Ah, I see the problem. An Image is not the same as a Texture. You are attempting to set an image to the sprite's texture property. You would need to make a new ImageTexture and set its data to myimage. Then you can use it for texturing.
SIsilicon28 @dzosek said: Hmm but how to do it? var img = Image.new() but how to add it data I said ImageTexture. Take a look at the docs.
dzosek Thank you very much for help . =) func _ready(): var myimage = preload("res://Untitled.jpg").get_data() var obrazek = ImageTexture.new() obrazek.create_from_image(myimage) $Sprite.set_texture(obrazek)