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 properly use store.* in conjunction with storyboard
How to set Corona notification big view
Set object or button above the video in corona sdk
selectively upgrade existing sqlite database in corona by comparing database versions
Corona Near Field Comunication (NFR)
How can i make random generated quotes
Using perspective library with Corona SDK
What is the right way to zoom the camera out from a scene view?
Corona SDK Runtime Error on version 3.0.0
corona loadRemoteImage loading in another scene
What is a simple splash screen code for corona?
How to resize pickerwheel on corona sdk
How to allow external music/audio to continue in Corona SDK apps when they launch?
Can I put apps made on Corona SDK for windows on IOS?
Define coordinates with rotation (corona sdk)
Open 3rd party application in corona sdk

Categories

HOME
artificial-intelligence
svn
gaming
cucumber
long-integer
haproxy
initialization
semantic-web
liferay-7
tfs2015
tibco
turbojpeg
linker
clone
scheduler
roku
bellman-ford
clickable-image
fasm
colors
chromecast
amazon-elb
hidden
scala-ide
android-custom-view
gitkraken
stackexchange.redis
sipp
cell
quartz.net
background-color
sap-lumira
pyspark-sql
bonita
xenapp
nsmutablearray
busboy
textmate2
strapi
xll
hidden-markov-models
sbjson
data-uri
oauth2-playground
cloudera-sentry
coverage.py
expandablelistview
jshint
docker-ucp
common-table-expression
return-type
nothing
brightscript
degrees
emf-compare
wildfly-9
yui3
dmarc
openseadragon
declarative
bbc-micro
accessibilityservice
okta-api
vim-plugin
sqlbase
roxygen2
cache-manifest
ocmockito
createfile
flurry-analytics
multivariate-testing
tabris
angular-ui-select
mfmessagecomposeview
fileshare
miglayout
meteor-collections
hotswap
frontbase
notifyjs
stty
delphi-xe4
office-app
user-forums
tridion-2011
multiscaleimage
ip-geolocation
arrow
viewpagerindicator
kaazing
monocross
autosize
differentiation
fork-join
simile
active-record-query
ccnet-config
tessellation
cleartype
3270
rakudo
activex-exe
levels
regioninfo
code-camp
word-automation
error-detection
account-management

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