sheraz amin
sheraz amin

Reputation: 1149

How can I access IPhone camera to take a picture Using corona

I'm new to programming and making an app for iphone and android with Corona SDK.I want to take a picture with Iphone camera and then save it for further work . How can I access the camera of a device in corona . Thanks in advance .

Upvotes: 2

Views: 6060

Answers (4)

Varsha
Varsha

Reputation: 558

You can use below url for implementing Camera successfully in your Corona App - http://developer.coronalabs.com/content/camera

Upvotes: 0

Sandhya Shettigar
Sandhya Shettigar

Reputation: 299

You can use this code it may useful to you,

local listener = function( event )
    if media.hasSource( media.Camera ) then
        media.show( media.Camera, sessionComplete )
    else
        native.showAlert("Corona", "Camera not found.")
    end
    return true
end

frameRect:addEventListener("tap",listener);

Upvotes: 0

Jonathan Beebe
Jonathan Beebe

Reputation: 468

You can use media.show() to use the camera in Corona.

Here is the API reference page: http://developer.anscamobile.com/reference/index/mediashow

And a usage example:

local onComplete = function(event)
local photo = event.target
    print( "photo w,h = " .. photo.width .. "," .. photo.height )
end

media.show( media.Camera, onComplete )

Upvotes: 2

kikito
kikito

Reputation: 52621

I've had a look at the API and it seems that you can't access the camera from Corona.

Upvotes: -1

Related Questions