corona


Cannot fit background image fully


So I am trying to fit my 350x570 image file fully as a background. But it's not working no matter what I do. Here's my code:
display.setStatusBar(display.HiddenStatusBar)
local background = display.newImageRect("background.png", display.contentWidth, display.contentHeight)
background.x = display.contentCenterX
background.y = display.contentCenterY
and here's what I get:
As shown in the image, there are two black bars because it's not fitted properly. But I don't know why. The code seems ok so what's the problem?
The internal coordinate system of Corona SDK depends on the content area defined in config.lua file. Point (0,0) is positioned at the top-left corner of this content area. If you are using the default Config.lua file then point (0,0) may not be positioned on the top-left corner of the screen.
Tutorial on modernizing the config.lua
https://coronalabs.com/blog/2013/09/10/modernizing-the-config-lua/
Ultimate Config.lua file
https://gist.github.com/pkoperek/11156473

Related Links

How to make the PNG's transparent region not be listened by the EventListener when a touch event happened?
Corona SDK - group with image rect, wrong reference point
CORONA SDK Physics that dont affect every sprite
corona storyboard dispatch event error
Web view Background trasparency
Changing display Image when interacting to other display
Tap on display objects in Corona SDK
Tableviews “slide down” when tapped in Widget 2.0
Display long text in fixed frame in Corona
Sound delay on emulator in corona sdk
Corona Sdk frame number per second
What is the difference adding view directly without following code
Corona SDK Touch Phases - Touch and Hold
corona sdk - scene keep old items
adding objects to screen in corona sdk without defining x y coordinates? corona sdk
Where is the log printed when I use print(“”) in Corona Engine?

Categories

HOME
svn
opencart
d3.js
activex
command-prompt
tabs
gallery
biztalk-2010
ontology
turbojpeg
jint
visualforce
tup
msmq
hystrix
scrape
grocery-crud
jodatime
max-msp-jitter
texas-instruments
temperature
pinterest
tomcat8
robolectric
cloudsim
xsl-fo
android-custom-view
spyder
tableview
gollum-wiki
password-generator
python-appium
running-object-table
pyspark-sql
guice
publishing
xmlunit
counting
db2-luw
formsauthenticationticket
ms-solver-foundation
installanywhere
identify
assert
imgur
grails3.2.0
dagger
music21
nothing
head.js
connect-direct
msxml
wildfly-9
elastic4s
bigdecimal
data-management
django-testing
sharepoint-apps
verisign
pack
json-spirit
python-cffi
textpattern
godeps
ibm-was
largenumber
kefir.js
mojo
hp-idol-ondemand
device-admin
xml-signature
visual-studio-6
aho-corasick
android-2.3-gingerbread
two.js
neo4jphp
commenting
oxygene
jchartfx
iosched
principalcontext
application-server
spiral
user-forums
onconfigurationchanged
instance-variables
live-wallpaper
java.lang.class
acpi
office-automation
jquery-1.4
libxslt
hungarian-notation
fgetc
inversion
twitter-feed
gui-designer
service-factory

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App