Hola,
Alguien sabe si es posible abrir la cámara y con ella abierta lanzar otro proceso ?
Gracias
![]() |
|
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
Lanzar otro proceso con la cámara activa
Yo creo que como mucho se puede hacer alguna cosa despues de lanzar la camara, però no encima de la misma. Sino por detras.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | local sessionComplete = function(event) local t = event.target print( "Camera ", ( t and "returned an image" ) or "session was cancelled" ) print( "event name: " .. event.name ) print( "target: " .. tostring( t ) ) end local listener = function( event ) media.show( media.Camera, sessionComplete ) print("mas acciones"); end |
Hola David,
Gracias, eso ya lo he probado. Lo que hace es lanzar algo una vez a finalizado el proceso de la camara, bien porque ha capturado una imagen o cancelado la acción.
La pregunta es, ¿se puede hacer algo mientras está activa? Estoy seguro que con las Apis de Android o Iphone, si se puede, pero con Corona?
Un saludo
Si lo haces donde he puesto el print("mas acciones") tambien se espera que termine el proceso de la camera?
David.
Si, en realidad lo ejecuta una vez tiene la imagen
Lo puedes probar en el ejemplo que tiene el sdk en sample code--> media
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | -- -- Abstract: Camera sample app -- -- Version: 1.1 -- -- Updated: August 9, 2010 -- -- Changes: -- Fixed logic problem where it said "session was cancelled" -- -- Sample code is MIT licensed, see http://developer.anscamobile.com/code/license -- Copyright (C) 2010 ANSCA Inc. All Rights Reserved. -- Camera not supported on Android devices in this build. local isAndroid = "Android" == system.getInfo("platformName") local isXcodeSimulator = "iPhone Simulator" == system.getInfo("model") if(isAndroid or isXcodeSimulator) then local alert = native.showAlert( "Information", "Camera API not available on Android or iOS Simulator.", { "OK"}) end -- local bkgd = display.newRect( 0, 0, display.contentWidth, display.contentHeight ) bkgd:setFillColor( 128, 0, 0 ) local text = display.newText( "Tap anywhere to launch Camera", 0, 0, nil, 16 ) text:setTextColor( 255, 255, 255 ) text.x = 0.5 * display.contentWidth text.y = 0.5 * display.contentHeight 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 = display.contentWidth/2 image.y = display.contentHeight/2 local w = image.width local h = image.height print( "w,h = ".. w .."," .. h ) end end local listener = function( event ) media.show( media.Camera, sessionComplete ) print("otra cosa") return true end bkgd:addEventListener( "tap", listener ) |
puede hacer algo mientras está activa? Estoy seguro que con las Apis de Android o Iphone, si se puede, pero con Corona?
*NO - deafortunadamente no es possible.
C.
Gracias Carlos, esto hace que descartemos utilizar AR con Corona, por ahora claro.

Forum: Report Spam + PM
send message and call to a person
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Application failed codesign verification - over and over again... ugh!!!!!!!
About the copy right of sound and image
Premium support?
Where are the co-founders
Is Corona SDK going to support the PARSE API?
Using the Google Places API with Corona
Any compatibility issues with iOS 4.3 and Xcode 4?
Help me out with a physics shape
Packing via Corona and Full Code Availability
Problem with timer.performWithDelay().