display.save saving only PORTION of the image

  I’m trying to save a screen shot to disk.  The screen capture looks okay on the simulator display, but when I go to the sandbox and open the file, the image is not complete (appears to contain only the bottom right quadrant of screen).  Am I doing somethig wrong here?

       screenCap = display.captureScreen  (false)

        local defaultPath = system.DocumentsDirectory
        display.save (screenCap, “scr3.jpg”, defaultPath)

            screenCap:scale( 0.25, 0.25 )
            screenCap.x = 200
            screenCap.y = 300

Thanks for reading!

Try scaling the image down/positioning it at the center of the screen before saving it.

If I am not mistaken, is only saves the image visible on screen (so if your screenshot is with its center at [0,0], the function will only save the bottom right of the image - that is the part visible).

That was precisely the problem; thank you!  I would have never figured that out on my own.  This should be in the “gotcha” section of the documentation.  So when the image is first captured, it is positioned on the top left portion of the screen with only the lower right quadrant “visible” to Corona… geez

Hi @eik,

Are you setting the “isFullResolution” flag within your call?

Brent

No I’m not using that flag, but the screen shot is not bigger than the screen.

My problem was that the screen shot display object was positioned automatically to x=0,y=0 with center alignment, so only the bottom right quadrant of the image was actually visible on screen.

I had no idea that Corona crops any off screen portion when saving. I also could not see that the image was in fact off screen, because I was repositioning & scaling it immediately after the save. Also didn’t feel the need to reposition the image before saving – this is definitely a “gotcha” for me.

Thanks for reading,

Try scaling the image down/positioning it at the center of the screen before saving it.

If I am not mistaken, is only saves the image visible on screen (so if your screenshot is with its center at [0,0], the function will only save the bottom right of the image - that is the part visible).

That was precisely the problem; thank you!  I would have never figured that out on my own.  This should be in the “gotcha” section of the documentation.  So when the image is first captured, it is positioned on the top left portion of the screen with only the lower right quadrant “visible” to Corona… geez

Hi @eik,

Are you setting the “isFullResolution” flag within your call?

Brent

No I’m not using that flag, but the screen shot is not bigger than the screen.

My problem was that the screen shot display object was positioned automatically to x=0,y=0 with center alignment, so only the bottom right quadrant of the image was actually visible on screen.

I had no idea that Corona crops any off screen portion when saving. I also could not see that the image was in fact off screen, because I was repositioning & scaling it immediately after the save. Also didn’t feel the need to reposition the image before saving – this is definitely a “gotcha” for me.

Thanks for reading,