iPhone 5/General Dynamic Scaling Question

--main.lua:  
w= display.contentWidth; h= display.contentHeight  
  
local isTall = display.pixelHeight == 1136 and display.pixelWidth == 640  
  
if isTall then  
local bkg = display.newImageRect("Background\_4inch.png",568,320)  
bkg.x=w\*0.5;bkg.y=h\*0.5  
else  
local bkg = display.newImageRect("Background.png",480,320)  
bkg.x=w\*0.5;bkg.y=h\*0.5  
end  
---  
--config.lua:  
  
application =   
{   
   
 content =   
 {   
 width = 320,  
 height = 480,  
 scale = "none",   
 },  
  
}   

Why is it that when I specify the width and height of my “iPhone 5”-only background image, I must set it to exactly half of the image’s actual resolution?

This happens when I do not have scaling, and imageSuffixes/thresholds specified in conflig.lua. I also only have one background image present for the iPhone 5. [import]uid: 73951 topic_id: 31066 reply_id: 331066[/import]

I have a hunch that it has to do with the Scale Factor, as that would be the only indicator given when there is an absence of specified thresholds in conflig.lua. Any clarification would be appreciated.

--Scale Factor:  
local deviceWidth = ( display.contentWidth - (display.screenOriginX \* 2) ) / display.contentScaleX  
local scaleFactor = math.floor( deviceWidth / display.contentWidth )  
print( scaleFactor )  

I base my assumption off this:
“(Why does Corona make you provide the height and width manually in display.newImageRect()? Because doing it automatically would require first loading the base image to find out its size, resulting in two image-loading operations rather than one. Since image loading is a very slow pipeline on mobile devices, it’s better to avoid the overhead by having you specify the known size and avoid the extra loading.)”

Source: http://www.coronalabs.com/blog/2011/01/27/dynamic-image-resolution-made-easy/ [import]uid: 73951 topic_id: 31066 reply_id: 124219[/import]

I have a hunch that it has to do with the Scale Factor, as that would be the only indicator given when there is an absence of specified thresholds in conflig.lua. Any clarification would be appreciated.

--Scale Factor:  
local deviceWidth = ( display.contentWidth - (display.screenOriginX \* 2) ) / display.contentScaleX  
local scaleFactor = math.floor( deviceWidth / display.contentWidth )  
print( scaleFactor )  

I base my assumption off this:
“(Why does Corona make you provide the height and width manually in display.newImageRect()? Because doing it automatically would require first loading the base image to find out its size, resulting in two image-loading operations rather than one. Since image loading is a very slow pipeline on mobile devices, it’s better to avoid the overhead by having you specify the known size and avoid the extra loading.)”

Source: http://www.coronalabs.com/blog/2011/01/27/dynamic-image-resolution-made-easy/ [import]uid: 73951 topic_id: 31066 reply_id: 124219[/import]