Thursday, August 20, 2020

Tip of the Day: Capturing Images from DB/Variable Image Controls
Product.......: R:BASE X.5 and R:BASE X.5 Enterprise (Version 10.5)
Build.........: 10.5.2.20820 or higher
Sections......: Forms
Keywords......: Image, Resolution, PROPERTY, Height, Width, GETPROPERTY

Did you know the "capture image from video" support for the DB Image
control, and now the Variable Image control as well, has been enhanced
considerably with camera selection, dimension, and image size options?

The PROPERTY command CaptureFromVideoEx parameter has been enhanced to
specify a maximum height, along with the current image format and maximum
width functionality. The ability to individually specify a maximum width
or maximum height, or both, provides the ability to resize the image so
that the final dimension fits inside the given dimension while preserving
the aspect ratio. Depending on the specified value pair, sometimes the
width will be the limiting factor, and sometimes it will be the height.

If you wish to capture a PNG image with a maximum width and height of 100
pixels, use the following:

PROPERTY EmployeePhoto CaptureFromVideoEx 'PNG 100 100'

The DB Image control can be to capture images from a camera in order to
save the data in a table. The Variable Image control can be used to capture
images and to save to a file. The DB Image column and Variable Image must
be assigned to the VARBIT data type.

The image capture process has been updated to make camera selection easier.
There are no longer Start/Stop buttons. The window will also resize based
on the dimension passed using the CaptureFromVideoEx parameter. The default
"view area" for the camera feed is 640x360.

Available Cameras
Additional properties for the DB/Variable Image controls include support to
capture available cameras for the device, and to set the active camera.

GETPROPERTY ImageCtrl DeviceCameras vCameras
Returns a comma separated list of attached camera devices. The functionality
allows an application to create a custom camera selection for the user.

GETPROPERTY ImageCtrl DefaultCamera vCamera
Returns the last camera used to take a picture. If a picture has not been
taken yet, this returns the first devices detected.

PROPERTY ImageCtrl DefaultCamera .vCamera
Sets the active camera for taking a picture.

Image Resolution
A property was also added to capture/set the resolution of the video feed.

GETPROPERTY ImageCtrl DefaultResolution vCameraRes
Returns the default resolution of the camera.

PROPERTY ImageCtrl DefaultResolution .vCameraRes
Sets the default resolution for the active camera.

After the device is selected, the supported resolutions are listed in a drop-
down on the right. If a dimension is specified with CaptureFromVideoEx, the
resolution size options are hidden. If no size option is specified, then the
drop-down will be displayed.

Very Best R:egards,

Razzak.

https://www.rbase.com
http://www.facebook.com/rbase/

--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/0MZSCx-1kMYh51k2X-00LHx7%40mrelay.perfora.net.

Reply via email to