Hi,
We are building an app for our newspaper that lets a user submit a photo with a caption, except I seem to be having trouble either saving or loading their image. The app takes the picture just fine, but when I go to reload the user’s image/caption, there is no photo. Here is what I have for that part of the code:
– save image from the camera
local sessionComplete = function(event)
local t = event.target
t.x = display.contentWidth/2
t.y = display.contentHeight/2
tv=display.newGroup()
tv:insert(t)
local baseDir = system.DocumentsDirectory
display.save( tv, “nctpic.jpg”, baseDir)
transition.to( tv, { time=500, delay=50, xScale=.13, yScale=.13, x=374, y=44 } )
inputGroup:insert(tv)
end
– load the picture from the user’s project
local function getPicture()
photoPath = system.pathForFile( “nctpic.jpg”, system.DocumentsDirectory )
local t = display.newImage(photoPath)
if t then
t.x = display.contentWidth/2
t.y = display.contentHeight/2
tv:insert(t)
transition.to( tv, { time=500, delay=500, xScale=.13, yScale=.13, x=374, y=44} )
inputGroup:insert(tv)
projectBody.text=“picture loaded”
else
projectBody.text=“no picture loaded”
end
end
I am testing on an iPod touch right now, with software version 4.3.1, and I am using Corona SDK 2011.484.
Any ideas?
Thanks!
[import]uid: 50201 topic_id: 9907 reply_id: 309907[/import]