Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

capture/save no longer works in build 2017.3038
Started by horacebury Jun 02 2017 11:07 PM

11 replies to this topic
capture save capturescreen build broken
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,069 posts
  • Corona SDK

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.



[TOPIC: post.html]
#2

Perry Clarke

[GLOBAL: userInfoPane.html]
Perry Clarke
  • Moderator

  • 850 posts
  • Corona Staff

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.

 

Attached File  Picture 6.jpg   45.23KB   0 downloads



[TOPIC: post.html]
#3

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,069 posts
  • Corona SDK

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.



[TOPIC: post.html]
#4

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,120 posts
  • Corona SDK

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



[TOPIC: post.html]
#5

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,069 posts
  • Corona SDK

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.)



[TOPIC: post.html]
#6

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,120 posts
  • Corona SDK

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)


[TOPIC: post.html]
#7

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,069 posts
  • Corona SDK

[TOPIC: post.html]
#8

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,120 posts
  • Corona SDK

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



[TOPIC: post.html]
#9

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,069 posts
  • Corona SDK

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

                    Version: 3.0.0
                    Build: 2017.3103


[TOPIC: post.html]
#10

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,069 posts
  • Corona SDK

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



[TOPIC: post.html]
#11

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,120 posts
  • Corona SDK

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



[TOPIC: post.html]
#12

Perry Clarke

[GLOBAL: userInfoPane.html]
Perry Clarke
  • Moderator

  • 850 posts
  • Corona Staff

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?




[topic_controls]
[/topic_controls]