[SOLVED] Capture screen totally broken in graphics 2.0

Just found that the capture screen functions do not work anymore in graphics 2.0 as they should.

I used this code (in graphics 1) to capture the whole screen:

                local screenCap = display.captureScreen()                 display.save( screenCap, "moment.jpg", system.TemporaryDirectory )                 screenCap:removeSelf()  

Now, this captures only about 1/4 of the right bottom of the screen.

Best solution I found is this but the image is missing about 50px top and bottom:

    display.save( display.currentStage,  { filename=picName, baseDir=system.TemporaryDirectory, isFullResolution=true } )  

Also tried a lot of different combinations of display.captureBounds(screenBounds) but this function really behaves crazy.

So, is there a way to capture the WHOLE screen in graphics 2.0 ???

(it is a bit hard to explain our customer that something that worked in their app now doesn’t) :wacko:

Using daily build 2179, tried on simulator and Android.

Can you provide a working sample that demonstrates this along with your build.settings and config.lua?

I am really sorry for the false alarm.

It still works. My teammate changed the config.lua to fixed width/height, (960/640) and that broke it.

Now back to ultimate config.lua and it works.

Regards,

Damir.

Can you provide a working sample that demonstrates this along with your build.settings and config.lua?

I am really sorry for the false alarm.

It still works. My teammate changed the config.lua to fixed width/height, (960/640) and that broke it.

Now back to ultimate config.lua and it works.

Regards,

Damir.

Hey, I just found out I also only capture “1/4 of the right bottom of the screen.”, exactly the same as you described in the first message.

My config lua is this:

local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { width = aspectRatio \> 1.5 and 800 or math.ceil( 1200 / aspectRatio ), height = aspectRatio \< 1.5 and 1200 or math.ceil( 800 \* aspectRatio ), scale = "letterBox", fps = 60, imageSuffix = { ["@2x"] = 1.3, }, }, }

I tested it on Simulator & iPad 4. I only get 1/4 of the screen.

Are you sure it’s how you fixed the problem by changing to ultimate config.lua?! Why is this related to this problem? Fix width/height should be fine too. Maybe something else?

I think I know why.

The captured display group is actually put at (0, 0) by default (center align), so it appears as 1/4 of the right bottom screen.

And display.save() can only save the display object that is on the screen, so I thought the function only captured 1/4.

Anyway…

another false alarm!  :stuck_out_tongue:

Hey, I just found out I also only capture “1/4 of the right bottom of the screen.”, exactly the same as you described in the first message.

My config lua is this:

local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { width = aspectRatio \> 1.5 and 800 or math.ceil( 1200 / aspectRatio ), height = aspectRatio \< 1.5 and 1200 or math.ceil( 800 \* aspectRatio ), scale = "letterBox", fps = 60, imageSuffix = { ["@2x"] = 1.3, }, }, }

I tested it on Simulator & iPad 4. I only get 1/4 of the screen.

Are you sure it’s how you fixed the problem by changing to ultimate config.lua?! Why is this related to this problem? Fix width/height should be fine too. Maybe something else?

I think I know why.

The captured display group is actually put at (0, 0) by default (center align), so it appears as 1/4 of the right bottom screen.

And display.save() can only save the display object that is on the screen, so I thought the function only captured 1/4.

Anyway…

another false alarm!  :stuck_out_tongue: