scaling down with letterbox and unexpected result with iphone 4 on simulator

Hi,

I know there are many article on content scaling and the best way seems to be defining content area for as many devices as possible. However, I’m doing a simple test with the following code in the hope to understand it further, so please help to explain me rather than referring me to other articles.

config.lua

application = { content = { width = 640, height = 1136, scale = "letterBox" } }

main.lua

local img = display.newImage("img.png") img.x = display.contentWidth/2 img.y = display.contentHeight/2

The image resolution is 640x1136 (exactly the same as content area). The display on iPhone5, 6, and 6 plus look ok to me but not on iphone 4. 

On iphone 4, I only expect the black bar on the left and right only but it has on the top and bottom too (To me it shouldn’t have the black bar on top and bottom because the content height and image height are the same).

Please help to explain why. Thank you.

Regards,

So Lin 

It works the way I think it should be when I use display.newImageRect. 

local img = display.newImageRect("img.png", 640, 1136)

I still wonder why display.newImage works well with iphone 5 and 6. Anybody explain this please?

Regards,

So Lin

Loading the image at its full resolution also show the image as expected.

local img = display.newImage("img.png", true)

Regards,

So Lin

Is it something to do with “safety feature” enforcing on image larger than 512 pixels?

Regards,

So Lin

It works the way I think it should be when I use display.newImageRect. 

local img = display.newImageRect("img.png", 640, 1136)

I still wonder why display.newImage works well with iphone 5 and 6. Anybody explain this please?

Regards,

So Lin

Loading the image at its full resolution also show the image as expected.

local img = display.newImage("img.png", true)

Regards,

So Lin

Is it something to do with “safety feature” enforcing on image larger than 512 pixels?

Regards,

So Lin