Hi,
I am trying to take a screenshot to post to Facebook. I’ve got it all working fine on an iPhone 4 and iPad. However, on iPhone 5 there is an extra black bar saved to the bottom of the image (see attached screenshot). I’m using this function:
[lua]display.save(screenshotGroup, “screenshot.jpg”, system.TemporaryDirectory)[/lua]
Bizarrely, when I view the photo in Finder, my Mac seems to think it is 320 x 568. However, the image is actually 320 x 672 (the black box has a height of 104).
I’ve also tried display.captureBounds and display.capture. I think the problem was exactly the same, but if not, it was certainly very similar (black box at the bottom of the image).
Perhaps I’m getting this problem because of the way I’m scaling for iPhone 5:
In config.lua I’m scaling with yAlign set to top:
[lua]application = {
content = {
width = 320,
height = 480,
scale = “letterbox”,
xAlign = “center”,
yAlign = “top”,
fps = 30,
imageSuffix = {
["@2x"] = 2,
["@4x"] = 4,
}
},
}[/lua]
Elsewhere, to adjust for tall screens I set object.y = [number between 0 and 480]*isTall, where isTall is defined by:
[lua]local isTall
if display.actualContentHeight/display.actualContentWidth > 480/320 then
isTall = (320 * display.actualContentHeight)/(display.actualContentWidth*480)
else
isTall = 1
end
[/lua]
It’s weird I’m experiencing this problem, because I don’t think I’ve seen it in the past. I am using build 1076, and haven’t updated… but I’ve checked my old apps and they’re now experiencing the same issue too.
Hope you can help,
Ed