Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

[SOLVED] Capture screen totally broken in graphics 2.0
Started by ubj3d.android Feb 16 2014 10:19 AM

4 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

ubj3d.android

[GLOBAL: userInfoPane.html]
ubj3d.android
  • Pro
  • PipPipPipPipPipPip
  • 506 posts
  • Jedi

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.



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Corona Staff
  • 8,598 posts
  • Jedi

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



[TOPIC: post.html]
#3

ubj3d.android

[GLOBAL: userInfoPane.html]
ubj3d.android
  • Pro
  • PipPipPipPipPipPip
  • 506 posts
  • Jedi

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.



[TOPIC: post.html]
#4

joe528

[GLOBAL: userInfoPane.html]
joe528
  • Pro
  • PipPipPipPipPipPip
  • 576 posts
  • Jedi

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?



[TOPIC: post.html]
#5

joe528

[GLOBAL: userInfoPane.html]
joe528
  • Pro
  • PipPipPipPipPipPip
  • 576 posts
  • Jedi

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!  :P




[topic_controls]
[/topic_controls]