Cameras
Extends: WEBCAM > CONTROL > WIDGET
A Webcam control controls a built-in or attached camera. It adds a few properties to the CONTROL properties.
CAMERA
Part of: WEBCAM
Controls which camera is active.
Syntax
GPROP name "CAMERA
PPROP name "CAMERA what
Description
CAMERA selects the camera whose feed Logo should display. Its input is either a number between 1 and the number of cameras attached to the computer, or the case-insensitive start of a camera name as returned by the CAMERAS property.
CAMERA also accepts a two-element list, where the first element is the camera name or number, and the second element is the desired width of the camera resolution in pixels. Many cameras support different resolutions, and Logo tries to match the supplied value as closely to the next available resolution as possible.
If there is no camera attached, the return value is -1.
Examples
DRAW ; Drop a WEBCAM widget from the Toolbox > Controls WEBCAM dropped GPROP “WEBCAM “CAMERA Result: Built-in camera
CAMERAS
Part of: WEBCAM
Outputs a list of camera names.
Syntax
GPROP name "CAMERAS
Description
CAMERAS outputs a list of cameras attached to the computer. You can use the name of a camera to select it with the CAMERA property.
Examples
DRAW ; Drop a WEBCAM widget from the Toolbox > Controls WEBCAM dropped GPROP “WEBCAM “CAMERAS Result: [Built-in camera]
RESOLUTION
Part of: WEBCAM
Outputs a two-element list of the current camera resolution.
Syntax
GPROP name "RESOLUTION
Description
RESOLUTION outputs a two-element list describing the resolution of the currently selected camera. The first element is the width and the second element is the height, both measured in pixels.
If no camera is attached, both values are 0.
Examples
DRAW ; Drop a WEBCAM widget from the Toolbox > Controls WEBCAM dropped GPROP “WEBCAM “RESOLUTION Result: [1080 768]
TITLE
Part of: WEBCAM
Outputs the name of the currently attached camera.
Syntax
GPROP name "TITLE
Description
The TITLE property outputs the name of the currently attached camera if there is one. If no camera is attached, it outputs the empty word.
Examples
DRAW ; Drop a WEBCAM widget from the Toolbox > Controls WEBCAM dropped GPROP “WEBCAM “TITLE Result: Built-in camera