Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 9.5   10.0   10.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2    Statistic    FMM    Blog  

AVRecorder.CaptureStillPhoto

Captures a still image.

Component Version macOS Windows Linux Server iOS SDK
AVRecorder 6.2 ✅ Yes ✅ Yes ❌ No ❌ No ✅ Yes
MBS( "AVRecorder.CaptureStillPhoto"; AVSession { ; FileName } )   More

Parameters

Parameter Description Example Flags
AVSession The ID for the AVRecorder session as returned by AVRecorder.Init. $AVSession
FileName The file name for the jpeg image. "still.jpg" Optional

Result

Returns image or error.

Description

Captures a still image.
The image is returned a JPEG image as container value on Mac and BMP on Windows.
Added Windows support with plugin version 6.5.
May require running the preview as we capture only current preview frame on Windows.

If you need content detection, you can always get current frame with AVRecorder.CaptureStillPhoto and pass it to OCR.SetImage for text recognition or Barcode.Detect to find different barcodes.

Examples

Init and Capture photo:

#Start session
Set Variable [$capture; Value:MBS( "AVRecorder.Init" )]
#Pick first video device
Set Variable [$r; Value:MBS( "AVRecorder.SetVideoDevice"; $capture; 0 )]
#Start preview
Set Variable [$r; Value:MBS("AVRecorder.StartPreview"; $capture)]
#Wait a bit to have camera get up and running
Pause/Resume Script [Duration (seconds): ,5]
#Take a picture
Set Variable [$r; Value:MBS( "AVRecorder.CaptureStillPhoto"; $capture )]
#Put in container
Set Field [test::Test; $r]
#Cleanup
Set Variable [$r; Value:MBS( "AVRecorder.Release"; $capture )]

See also

Release notes

Example Databases

Blog Entries

Created 2nd May 2016, last changed 30th August 2018


AVRecorder.AuthorizationStatusForMediaType - AVRecorder.ClosePreview

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins

Start Chat