capture/save no longer works in build 2017.3038

This code no longer works in build 2017.3038 - I don’t know when this started:

local function testScreenGrab() display.newCircle( display.contentCenterX, display.contentCenterY, display.contentCenterX ).fill = {1,0,0} timer.performWithDelay( 5000, function() display.captureScreen( true ):removeSelf() end, 1 ) end testScreenGrab()

TL;DR: It’s impossible to capture an image on macOS with the latest daily build.

Do you really mean build 2017.3038?  CoronaSDK 2017.3085 is the latest daily build.

The code above works for me (nothing happens on the screen because the creation of the displayObject by captureScreen and the removeSelf happen in the same frame).  The captured image file contains the right image.

Build 2017.3103 does not work:

local function testScreenGrab2() display.newCircle( display.contentCenterX, display.contentCenterY, display.contentCenterX ).fill = {1,0,0} timer.performWithDelay( 5000, function() local cap = display.captureScreen( true ) print("capture") -- cap:removeSelf() -- print("removeSelf") end, 1 ) end testScreenGrab2()

Captures only a blank png.

If you use just display.captureScreen() do you see the capture on your screen?

Like this?

local function testScreenGrab3() display.newCircle( display.contentCenterX, display.contentCenterY, display.contentCenterX ).fill = {1,0,0} timer.performWithDelay( 3000, function() local cap = display.captureScreen() print("capture") transition.to( cap, { time=1500, x=display.contentCenterX, y=display.contentCenterY } ) end, 1 ) end testScreenGrab3()

I get nothing. The screen grab is always just (in my case) a grey rectangle. That’s because I’m setting the background colour to grey, but even if I don’t I just get a black rectangle (the default colour.)

What do you get with JUST this in main.lua?  The red circle should move after 1 s

local circle = display.newCircle( display.contentCenterX, display.contentCenterY, 100 ) circle.fill = {1,0,0} timer.performWithDelay(1000, function() local cap = display.captureScreen() cap.x,cap.y = display.contentCenterX + 100, display.contentCenterY end)

I get this: https://www.dropbox.com/s/pjvh0jai3z30ard/Untitled.mov?dl=0

try updating to a later build. 2017.3038 is a really old build and this has probably since been fixed

Copyright © 2009-2017  C o r o n a   L a b s   I n c .

                    Version: 3.0.0

                    Build: 2017.3103

Fairly disheartened now, because your code does not appear to work on mine. Could you provide a screen shot/video of yours, please?

Here’s the code file I just executed: https://www.dropbox.com/s/q4t4cf3681ywz8n/main.lua?dl=0

Here’s the video: https://www.dropbox.com/s/jtxqdyuc8763ale/Untitled2.mov?dl=0

You should obviously get a second red circle 100 px to the right after 1 second.  I am not sure if it didn’t work or was off screen - have you tried it in landscape?

If this doesn’t work for you then use my code as a simple use case and report it to support at coronalabs.com

All the code snippets you’ve sent seem work fine for me.  

Can you send us a small project that demonstrates the issue when you run it?

Do you really mean build 2017.3038?  CoronaSDK 2017.3085 is the latest daily build.

The code above works for me (nothing happens on the screen because the creation of the displayObject by captureScreen and the removeSelf happen in the same frame).  The captured image file contains the right image.

Build 2017.3103 does not work:

local function testScreenGrab2() display.newCircle( display.contentCenterX, display.contentCenterY, display.contentCenterX ).fill = {1,0,0} timer.performWithDelay( 5000, function() local cap = display.captureScreen( true ) print("capture") -- cap:removeSelf() -- print("removeSelf") end, 1 ) end testScreenGrab2()

Captures only a blank png.

If you use just display.captureScreen() do you see the capture on your screen?

Like this?

local function testScreenGrab3() display.newCircle( display.contentCenterX, display.contentCenterY, display.contentCenterX ).fill = {1,0,0} timer.performWithDelay( 3000, function() local cap = display.captureScreen() print("capture") transition.to( cap, { time=1500, x=display.contentCenterX, y=display.contentCenterY } ) end, 1 ) end testScreenGrab3()

I get nothing. The screen grab is always just (in my case) a grey rectangle. That’s because I’m setting the background colour to grey, but even if I don’t I just get a black rectangle (the default colour.)

What do you get with JUST this in main.lua?  The red circle should move after 1 s

local circle = display.newCircle( display.contentCenterX, display.contentCenterY, 100 ) circle.fill = {1,0,0} timer.performWithDelay(1000, function() local cap = display.captureScreen() cap.x,cap.y = display.contentCenterX + 100, display.contentCenterY end)

I get this: https://www.dropbox.com/s/pjvh0jai3z30ard/Untitled.mov?dl=0

try updating to a later build. 2017.3038 is a really old build and this has probably since been fixed

Copyright © 2009-2017  C o r o n a   L a b s   I n c .

                    Version: 3.0.0

                    Build: 2017.3103