Hello,
I’m using the display.save() method to save some images within my application but it only seems to work intermittently. I am trying to save an imageRect object, and sometimes it works as expected and other times it creates the image that looks a bit corrupted such as the one attached.
Image being copied:
Corrupted Image:
My code looks similar to this (although I removed some additional logic to make it simpler to read).
local function saveWithDelay(event)
display.save(event.source.itemToSave, { baseDir = system.ApplicationSupportDirectory, filename="new_image.png", captureOffscreenArea=true})
end
local imageRect = display.newImageRect( imageFile , baseDir, imageWidth, imageHeight)
local tm = timer.performWithDelay( 100, saveWithDelay )
tm.params.itemToSave = imageRect
Has anyone encountered this problem?
Also, I’m seeing this on the simulator. I have not tested this on another device yet.