Hopefully someone can help me with my problem!!
I'll try to explain this as fully as possible, with code!
So what i am doing in the following code is that i am loading a photo from camera roll in the function newphoto. After complete it is going to the function sessionComplete. In sessionComplete the image is displayed on the screen and also saves the photo.
local function sessionComplete ( event ) t = event.target local baseDir = system.DocumentsDirectory display.save(t, "photo.jpg", baseDir) t.x = _W/2 t.y = _H/2 t.xScale = .25 t.yScale = .25 end local function newphoto ( event ) if (event.phase == "began") then media.show( media.PhotoLibrary, sessionComplete ) return true end end UploadBar:addEventListener("touch", newphoto)
Now in a different lua document. i try to display the image. The problem now is that the same photo is disproportional. I tried everything that i could think of... any help PLEASE!
local baseDir = system.DocumentsDirectory background = display.newImage("photo.jpg",baseDir) background:setReferencePoint(display.CenterReferencePoint); background.x = _W/2 background.y = _H/2 background.xScale = 1 background.yScale = 1