This code works quite consistently on my desktop (OSX) but keeps producing empty images on Android. So either the file size is 0, or very rarely it actually generates the output image but subsequently does not overwrite it when I try again. So might work once if very lucky but generally never works.
If I choose "Upload to Photos" on the share dialog, it sometimes shows the image thumbnail but claims the size also to be 0. Tried to share to gmail as well but got error with empty media or such.
What am I doing wrong here?
function picsThatDidNotHappen(filename$)
Render()
left = GetScreenBoundsLeft()
right = GetScreenBoundsRight() + Abs(left)
top = GetScreenBoundsTop()
bottom = GetScreenBoundsBottom() + Abs(top)
imgId = GetImage(left, top, right, bottom)
Message("Image taken, size and coords: l="+str(left)+" r="+str(right)+" b="+str(bottom)+" t="+str(top))
SaveImage(imgId, filename$)
ShareImage(filename$)
ClearScreen()
DeleteImage(imgId)
endfunction