Hi,
I am a newbie to this sdk.just started my learning.Excuse if question sounds absurd.
I want to take an image using Tablet camera and save it in the tablet.I am using media.show(media.Camera,listener,filePath) to take image and trying to save it.But this is not getting saved by the name i give. It is getting saved with the tablet’s current time(eg:20120907_101245.jpg).Now,how can i save image by the name i give. This is the code.Do i have to use media.save()???if so, how can i use it along with media.show???
Any help would be appreciated.
local sessionComplete = function(event)
local image = event.target
print( "Camera ", ( image and “returned an image” ) or “session was cancelled” )
print( "event name: " … event.name )
print( "target: " … tostring( image ) )
if image then
local w = image.width
local h = image.height
print( “w,h = “… w …”,” … h )
end
end
filePath = { baseDir = system.DocumentsDirectory, filename = “testing.jpg”,type = “image” }
local listener = function( event )
if media.hasSource( media.Camera ) then
media.show( media.Camera, sessionComplete,filePath)
else
native.showAlert(“Corona”, “Camera not found.”)
end
return true
end
bkgd:addEventListener( “tap”, listener ) [import]uid: 168398 topic_id: 30703 reply_id: 330703[/import]