How can I add a picture in my app?

Hello…

I have a great idea for an app…(great!!)

Let’s start…

How do I add a picture in my app?

let,s say I have my enterScene and I have a rectangle or a button

I tap that button and I can take a picture with my iPad camara

The camara will ask me

– is this good

– or you want to re-take the photo

I click Okay, and I have that image(photo) in my own app…

it might be complicated or not I have no idea

where do I start or how do I do this

Thanks for all your help.

You can start by looking at the sample code that comes with the Corona installation (look in the folder where Corona is installed.)

There is an example that shows how to use the camera.  It does pretty much exactly what you described.

You can then take that and modify it to do something new, interesting, and fun.

I think the specific example is ‘~\Corona SDK\Sample Code\Media\Camera’

Cheers,

Ed

Question?  Is ‘helloworld2013d’ a shared account?  It has 585 posts, but you seem like you’re new?  I’m not trying to be insulting, just trying to understand, so I can answer appropriately in the future  - Thanks

Hi roaminggamer …

I have been using corona for 2 years now.

starting from 0, or less than 0.

I always use the “Newbie” part of the forum to ask a question.

it’s easy for me.

and YES! I am new at many areas…

should I do it somewhere else? maybe?

as far as the camera, I will look in that code

thanks

victor

Hi roaminggamer …

I got the camera app.

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         -- center image on screen         image.x = centerX         image.y = centerY         local w = image.width         local h = image.height         print( "w,h = ".. w .."," .. h )     end end

If I want to add an event listener to the actual photo

how do I do that, I add the “touch” function to the image

but that is NOT the actual image of the picture

I do this and is not working

function image:touch( event )     if event.phase == "began" then         image.rotation = 45         -- set touch focus         display.getCurrentStage():setFocus( self )         self.isFocus = true     elseif self.isFocus then         if event.phase == "moved" then         elseif event.phase == "ended" or event.phase == "cancelled" then     image.rotation = 0             -- reset touch focus             display.getCurrentStage():setFocus( nil )             self.isFocus = nil         end     end     return true     end     image:addEventListener( "touch", image )

Thanks

You can start by looking at the sample code that comes with the Corona installation (look in the folder where Corona is installed.)

There is an example that shows how to use the camera.  It does pretty much exactly what you described.

You can then take that and modify it to do something new, interesting, and fun.

I think the specific example is ‘~\Corona SDK\Sample Code\Media\Camera’

Cheers,

Ed

Question?  Is ‘helloworld2013d’ a shared account?  It has 585 posts, but you seem like you’re new?  I’m not trying to be insulting, just trying to understand, so I can answer appropriately in the future  - Thanks

Hi roaminggamer …

I have been using corona for 2 years now.

starting from 0, or less than 0.

I always use the “Newbie” part of the forum to ask a question.

it’s easy for me.

and YES! I am new at many areas…

should I do it somewhere else? maybe?

as far as the camera, I will look in that code

thanks

victor

Hi roaminggamer …

I got the camera app.

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         -- center image on screen         image.x = centerX         image.y = centerY         local w = image.width         local h = image.height         print( "w,h = ".. w .."," .. h )     end end

If I want to add an event listener to the actual photo

how do I do that, I add the “touch” function to the image

but that is NOT the actual image of the picture

I do this and is not working

function image:touch( event )     if event.phase == "began" then         image.rotation = 45         -- set touch focus         display.getCurrentStage():setFocus( self )         self.isFocus = true     elseif self.isFocus then         if event.phase == "moved" then         elseif event.phase == "ended" or event.phase == "cancelled" then     image.rotation = 0             -- reset touch focus             display.getCurrentStage():setFocus( nil )             self.isFocus = nil         end     end     return true     end     image:addEventListener( "touch", image )

Thanks