Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Is it possible to save a snapshot to a file?
Started by playthisstudios Oct 08 2013 05:09 PM

12 replies to this topic
snapshot
[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

playthisstudios

[GLOBAL: userInfoPane.html]
playthisstudios
  • Enthusiast

  • 71 posts
  • Corona SDK

Hi all,

 

Just looking at the new snapshot functionality and I am wondering if it is possible to save the snapshot to a file?

 

Thanks

 

 



[TOPIC: post.html]
#2

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

Yes, you can use display.capture. However, there are known issues with display.capture right now that we're fixing:

 

http://docs.coronalabs.com/tachyon/guide/graphics/knownIssues.html



[TOPIC: post.html]
#3

playthisstudios

[GLOBAL: userInfoPane.html]
playthisstudios
  • Enthusiast

  • 71 posts
  • Corona SDK

Thanks for the response Walter,

 

So just to clarify, will display.capture(), when the bugs are fixed, only save the visible (screen) portion of the snapshot, or will it save the entire snapshot whether it is onscreen or not?

 

Regards,

 

 

David M

 

 

 

 



[TOPIC: post.html]
#4

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

The behavior should match what display.capture() would for other display objects, which if I remember correctly, is the onscreen portion.



[TOPIC: post.html]
#5

playthisstudios

[GLOBAL: userInfoPane.html]
playthisstudios
  • Enthusiast

  • 71 posts
  • Corona SDK

Will there be any way to get the complete render to texture to a file? The particular application is for photo manipulation - at the moment there is no way to "export" edited images at anything above screen resolution. I was hoping to use the snapshot feature to put the original resolution images into and then save it out.

 

Thanks

 

D



[TOPIC: post.html]
#6

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

Oh, good idea, so something like this:

 

snapshot:save( "mySnapshot.png", system.DocumentsDirectory )

 
I'm adding as a feature request. Just keep in mind we're focused on fixing bugs so people can ship apps with the current feature set.


[TOPIC: post.html]
#7

playthisstudios

[GLOBAL: userInfoPane.html]
playthisstudios
  • Enthusiast

  • 71 posts
  • Corona SDK

Exactly what I am after - thanks for the help Walter! Will keep a lookout for it when you guys get time.

 

David M



[TOPIC: post.html]
#8

playthisstudios

[GLOBAL: userInfoPane.html]
playthisstudios
  • Enthusiast

  • 71 posts
  • Corona SDK

Just thinking - this would also allow people to take "screenshots" of games that are larger than one screen (which I happen to be working on as well)

 

D



[TOPIC: post.html]
#9

jonjonsson

[GLOBAL: userInfoPane.html]
jonjonsson
  • Corona Geek

  • 1,051 posts
  • Corona SDK

Also allows us to make proper iOS 7 wallpapers since the size is bigger than the actual size of the screen due to the shifting effect.



[TOPIC: post.html]
#10

RedBeach

[GLOBAL: userInfoPane.html]
RedBeach
  • Corona Geek

  • 1,132 posts
  • Corona SDK

[TOPIC: post.html]
#11

RedBeach

[GLOBAL: userInfoPane.html]
RedBeach
  • Corona Geek

  • 1,132 posts
  • Corona SDK

Daily Build 2013.2090 added the option to save/capture displayObjects with full resolution.



[TOPIC: post.html]
#12

RedBeach

[GLOBAL: userInfoPane.html]
RedBeach
  • Corona Geek

  • 1,132 posts
  • Corona SDK

Just extra info. The new display.save / capture with Full Resolution is buggy in some android devices (in my case, in a Galaxy S1). It saves a black image.

 

So, be sure to test it before using it.



[TOPIC: post.html]
#13

RedBeach

[GLOBAL: userInfoPane.html]
RedBeach
  • Corona Geek

  • 1,132 posts
  • Corona SDK

Just found out that it is also buggy on iOS. I think depends of the size of the image that you try to save...




[topic_controls]
[/topic_controls]