Quote: "
Scraggle was correct. It needs to be an image, not a memblock.
"
Thank you both. This test makes it more explicit, the call to CreateSprite() fails.
image1 as integer
memblock1 as integer
image1 = 10
memblock1 = 20
LoadImage(image1, "Convidados.png")
CreateMemblockFromImage(memblock1, image1)
sprite = CreateSprite(memblock1)
This still leaves me curious as to what is happening as regards images and memory usage.
HandsOnAGK 1st Edition, page 929, gives this example code for working with memblocks and images:
myMemImage = CreateMemblockFromImage(LoadImage("BottleBrush.png"))
CreateSprite(1, CreateImageFromMemblock(myMemImage))
So what happened to the two images that were generated as function parameters? Did they get automatically destroyed at the end of the function call, or is this a memory leak? Presumably they don't get destroyed since if you delete a sprite's image it no longer looks correctly. If I need to free up memory and delete a sprite and its image, I can recover the image ID using GetSpriteImageID(), but this is not a property held by memblocks, so how would I delete the image used to spawn it?
Goo Goo G\'Joob!