Difference between revisions of "Camera"

From GiderosMobile
Line 26: Line 26:
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
 
=== <translate>Methods</translate> ===
 
=== <translate>Methods</translate> ===
[[Special:MyLanguage/camera.availableDevices|camera.availableDevices]] ''<translate>Return a list of available devices.</translate>''<br/><!-- GIDEROSMTD:camera.availableDevices -->
+
[[Special:MyLanguage/camera.availableDevices|camera.availableDevices]] ''<translate>Return a list of available devices.</translate>''<br/><!-- GIDEROSMTD:camera.availableDevices() Return a list of available devices. -->
[[Special:MyLanguage/camera.start|camera.start]] ''<translate>Start streaming camera pictures to a Texture</translate>''<br/><!-- GIDEROSMTD:camera.start -->
+
[[Special:MyLanguage/camera.start|camera.start]] ''<translate>Start streaming camera pictures to a Texture</translate>''<br/><!-- GIDEROSMTD:camera.start(texture,device) Start streaming camera pictures to a Texture -->
[[Special:MyLanguage/camera.stop|camera.stop]] ''<translate>Stop camera streaming.</translate>''<br/><!-- GIDEROSMTD:camera.stop -->
+
[[Special:MyLanguage/camera.stop|camera.stop]] ''<translate>Stop camera streaming.</translate>''<br/><!-- GIDEROSMTD:camera.stop() Stop camera streaming. -->
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
 
=== <translate>Events</translate> ===
 
=== <translate>Events</translate> ===
 
=== <translate>Constants</translate> ===
 
=== <translate>Constants</translate> ===
 
|}
 
|}

Revision as of 15:32, 13 September 2018


Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.png
Available since: Gideros 2017.8

Description

Renders live camera stream into a Texture

Examples

Example

require "camera"

-- Probe camera size (use a dummy 512x512 surface)
Camera.texture=Texture.new(nil,512,512)
cw,ch=Camera.start(Camera.texture)
Camera.stop()

-- Restart camera with a full sized texture
Camera.texture=Texture.new(nil,cw,ch,true)
cw,ch=Camera.start(Camera.texture)

application:setLogicalDimensions(ch,cw)

local b=Bitmap.new(Camera.texture) 
stage:addChild(b)

Methods

camera.availableDevices Return a list of available devices.
camera.start Start streaming camera pictures to a Texture
camera.stop Stop camera streaming.

Events

Constants