vid:capture-image
vid:capture-image width height
Captures an image from the currently selected active source.
If width and height are not specified, the image is captured at the current source resolution.
Example:
extensions [ vid bitmap ]
to capture
; capture an image if a video source is open,
; have the user select a camera if no video source found
carefully [
; when camera open, take an image
let image vid:capture-image ; returns image suitable for use with bitmap extension
bitmap:copy-to-drawing image 0 0
] [
if error-message = "Extension exception: vid: no selected source" [
vid:camera-select
vid:start
let image vid:capture-image
bitmap:copy-to-drawing image 0 0
]
]
end
If you want to capture images at a different resolution, simply replace vid:capture-image
with, e.g., (vid:capture-image 640 480)
.
Errors:
- Message
"vid: no selected source"
: There is no currently selected video source. Select a source withvid:movie-open
,vid:movie-select
,vid:camera-open
, orvid:camera-select
. - Message
"vid: invalid dimensions"
: The selected dimensions are invalid (one of the dimensions is zero or negative).
Take me to the full Vid Extension Dictionary