Screen capture - simulator feature

Wondering why is there no screen capture on the simulator menu ?

Everyone needs this (we have to submit various screenshots to Apple at least, right ?).

Right now, I am using the display.captureScreen( true ) from code, but this can sometimes be awkward.

:rolleyes:

Just take grabs from the device???

And if I have not all the devices ?

You can also just take a screen capture from the Windows or Mac simulator.  On Windows, the PrintScr key copies your screen to the clipboard – then you can paste it into an image editing program and crop it.  On Mac, there are a few shortcuts to capture the screen.  Command-Shift-3 captures the screen and immediately saves it to a file on your desktop.

  • Andrew

Yes, but you do not get the exact resolution(s) you need and I guess the print-screen would also capture the phone image + you have some work to do with image adjusting etc.

With display.captureScreen( true ) you get exactly what you need.

Oh no…

Is this is bug or what ?

On my laptop (Corona build 1135) I can’t zoom in on the simulator as much as on my desktop, and the screenshots are not in the right resolutions (e.g. iPhone 4, max zoom gives a 480x320 !?)

Why don’t you use the XCode Simulator? Pretty sure it’s got a direct screen grab feature.

I am more used to using Windows and only have MacBook Air, I am not very comfortable using it.

Just take grabs from the device???

And if I have not all the devices ?

You can also just take a screen capture from the Windows or Mac simulator.  On Windows, the PrintScr key copies your screen to the clipboard – then you can paste it into an image editing program and crop it.  On Mac, there are a few shortcuts to capture the screen.  Command-Shift-3 captures the screen and immediately saves it to a file on your desktop.

  • Andrew

Yes, but you do not get the exact resolution(s) you need and I guess the print-screen would also capture the phone image + you have some work to do with image adjusting etc.

With display.captureScreen( true ) you get exactly what you need.

Oh no…

Is this is bug or what ?

On my laptop (Corona build 1135) I can’t zoom in on the simulator as much as on my desktop, and the screenshots are not in the right resolutions (e.g. iPhone 4, max zoom gives a 480x320 !?)

Why don’t you use the XCode Simulator? Pretty sure it’s got a direct screen grab feature.

I am more used to using Windows and only have MacBook Air, I am not very comfortable using it.

i also say,

what be an awesome feature to have a simple screenshot button in the simulator

so whatever device and its size choose, we get the same resolution in our screenshot

without hasseling xcode etc.

should be a piece of cake for our great corona devs to implement that feature into the simulator, or!? :slight_smile:

greets

chris

i also say,

what be an awesome feature to have a simple screenshot button in the simulator

so whatever device and its size choose, we get the same resolution in our screenshot

without hasseling xcode etc.

should be a piece of cake for our great corona devs to implement that feature into the simulator, or!? :slight_smile:

greets

chris

We should open a request for this feature!

This has worked for me:

local function screenshot() --I set the filename to be "widthxheight\_time.png" --e.g. "1920x1080\_20140923151732.png" local date = os.date( "\*t" ) local timeStamp = table.concat({date.year .. date.month .. date.day .. date.hour .. date.min .. date.sec}) local fname = display.pixelWidth.."x"..display.pixelHeight.."\_"..timeStamp..".png" --capture screen local capture = display.captureScreen(false) --make sure image is right in the center of the screen capture.x, capture.y = display.contentWidth \* 0.5, display.contentHeight \* 0.5 --save the image and then remove local function save() display.save( capture, { filename=fname, baseDir=system.DocumentsDirectory, isFullResolution=true } ) capture:removeSelf() capture = nil end timer.performWithDelay( 100, save, 1) return true end --works in simulator too local function onKeyEvent(event) if event.phase == "up" then --press s key to take screenshot which matches resolution of the device if event.keyName == "s" then screenshot() end end end Runtime:addEventListener("key", onKeyEvent)

I’ll give it a try, thanks!