Hi,
thank you for your answer.
I tried with the function “display.captureScreen(true)”.
But to make some kind of animation, I created an image with display.newImage() wich appear and fade away.
function beforeSave()
image\_temp = display.newImage(images\_name[imgNum], system.DocumentsDirectory)
image\_temp.alpha = 0
local scaleImage = 1
if image\_temp.width \> image\_temp.height then
scaleImage = screenW/image\_temp.width
image\_temp.xScale = scaleImage
image\_temp.yScale = scaleImage
image\_width = math.ceil(image\_temp.width\*scaleImage)
image\_height = math.ceil(image\_temp.height\*scaleImage)
else
scaleImage = screenH/image\_temp.height
image\_temp.xScale = scaleImage
image\_temp.yScale = scaleImage
image\_width = math.ceil(image\_temp.width\*scaleImage)
image\_height = math.ceil(image\_temp.height\*scaleImage)
end
image\_temp.x = images[imgNum].x -- position x of the original image
image\_temp.y = images[imgNum].y -- position y of the original image
transition.to(image\_temp, { time=1000, alpha=1, transition=easing.outExpo, onComplete=saveIt } )
end
function saveIt()
display.captureScreen(true)
afterSave()
end
function afterSave()
transition.to(image\_temp, { time=1000, x=0, transition=easing.outExpo } )
transition.to(image\_temp, { time=1000, y=0, transition=easing.outExpo } )
transition.to(image\_temp, { time=1000, alpha=0, transition=easing.outExpo } )
transition.to(image\_temp, { time=1000, xScale=0, transition=easing.outExpo } )
transition.to(image\_temp, { time=1000, yScale=0, transition=easing.outExpo } )
timer.performWithDelay(400, afterSaveEnd)
end
function afterSaveEnd()
image\_temp:removeSelf()
transition.to(mainGroup, { time=500, alpha=1, transition=easing.outExpo } )
transition.to(infosGroup, { time=500, alpha=1, transition=easing.outExpo } )
transition.to(btnLess, { time=500, alpha=1, transition=easing.outExpo } )
end
In the function afterSaveEnd(), the image doesn’t remove because of display.captureScreen(true). Did I make some mistake ?
Regards,
Xuan. [import]uid: 7826 topic_id: 1659 reply_id: 4820[/import]