CameraComponent¶
Qualified name: delphifmx.CameraComponent
- class CameraComponent¶
Bases:
FmxObject
Methods
Returns an array of available video capture settings.
Getter of CaptureSetting.
It returns the available capture settings.
Displays the captured data on a bitmap.
Setter of CaptureSetting.
Attributes
ActionClient
Specifies whether the component object has an associated action.
Enables and disables the camera device.
Array with the available capture settings.
Current frame capture configuration.
Priority criterion for sorting the result of the available frame settings.
Children
Stores an array of children attached to this parent component.
ChildrenCount
Read-only property that specifies the number of children in the children list.
ClassName
Returns the TObject.ClassName
ComObject
Specifies the interface reference implemented by the component.
ComponentCount
Returns the owned component count
ComponentIndex
Indicates the position of the component in its owner's Components property array.
ComponentState
Describes the current state of the component, indicating when a component needs to avoid certain actions.
ComponentStyle
Governs the behavior of the component.
Components
Returns an iterator over the owned components
Data
Stores a Tvalue, which is a data structure that can store different kinds of data types.
DesignInfo
Contains information used by the Form designer.
Embarcadero Technologies does not currently have any additional information.
Embarcadero Technologies does not currently have any additional information.
Embarcadero Technologies does not currently have any additional information.
Indicates whether the camera device has torch.
Index
Specifies the index of the child object in the children array attached to this object.
default, front, or back camera.
Name
Specifies the name of the component as referenced in code.
Observers
Indicates the TObservers object added to the TComponent.
Owner
Returns the Component Owner
Parent
Returns/Sets the Control Visibility
States the quality of the video capture.
Root
Specifies the root parent of this object.
Stored
Specifies whether this object is stored in the .XFM file.
StyleName
Specifies the style name for this FMX component.
Tag
Stores a NativeInt integral value as a part of a component.
TagFloat
Custom property that stores any floating-point value.
TagObject
Custom property that stores any object value.
TagString
Custom property that stores any string value.
on, off, or auto.
VCLComObject
Represents information used internally by components that support COM.
- Active¶
Enables and disables the camera device. Set the Active property to True to enable the camera device, and set Active to False to disable it.
- Type:
bool
- AvailableCaptureSettings¶
Array with the available capture settings. You can use CaptureSettingPriority to set the criterion to sort the Array. Use the CaptureSetting property to set the capture data resolution. See the Quality property for further details.
- Type:
tuple
- CaptureSetting¶
Current frame capture configuration. Use the CaptureSetting property to set the capture data resolution from the available ones. See the Quality property for further details.
- Type:
VideoCaptureSetting
- CaptureSettingPriority¶
Priority criterion for sorting the result of the available frame settings. See the Quality property for further details.
- Type:
VideoCaptureSettingPriority
- FlashMode¶
Embarcadero Technologies does not currently have any additional information.
- Type:
FlashMode
- FocusMode¶
Embarcadero Technologies does not currently have any additional information.
- Type:
FocusMode
- GetAvailableCaptureSettings(ACanvasClass: CanvasClass) tuple ¶
Returns an array of available video capture settings.
- GetCaptureSetting()¶
Getter of CaptureSetting.
- GetDefaultCanvasCaptureSettings()¶
It returns the available capture settings.
Note: The returning array is sorted with the CaptureSettingPriority criteria.
- HasFlash¶
Embarcadero Technologies does not currently have any additional information.
- Type:
bool
- HasTorch¶
Indicates whether the camera device has torch. Use the HasTorch property to see whether the camera device has torch.
- Type:
bool
- Kind¶
default, front, or back camera. The Kind property can take one of three values enumerated by TCameraKind: Default, FrontCamera, and BackCamera. For example, to select the back camera of the CameraComponent1 TCameraComponent you can use the following line:
Delphi:
CameraComponent1.Kind := TCameraKind.BackCamera;
C++:
CameraComponent1->Kind = TCameraKind::BackCamera;
- Type:
CameraKind
- Type:
Selects the kind of camera device
- Quality¶
States the quality of the video capture. The Quality property of type TVideoCaptureQuality can take one of the following values:
Value
Meaning
PhotoQuality
The captured data has high-resolution photo quality.
HighQuality
The captured data has high resolution (depending on the device).
MediumQuality
The captured data has medium resolution (depending on the device).
LowQuality
The captured data has low resolution (depending on the device).
CaptureSettings
This option allows you to set a customized capture data resolution.
By default, Quality is set to CaptureSettings and it uses the best available camera quality (best resolution and best frame rate) prioritizing first the Resolution. For example, to change the Quality of the CameraComponent1 TCameraComponent to LowQuality, you can use the following line:
Delphi:
CameraComponent1.Quality := TVideoCaptureQuality.LowQuality;
C++:
CameraComponent1->Quality = TVideoCaptureQuality::LowQuality;
Setting a Custom Quality Capture Setting By setting the Quality to TVideoCaptureQuality.CaptureSettings you can set a customized capture data resolution:
Use the AvailableCaptureSettings property to see the Array with the different supported configurations. You can use CaptureSettingPriority to set the criterion to sort the Array of the AvailableCaptureSettings to prioritize Resolution or FrameRate when sorting the Array. See TVideoCaptureSettingPriority for further information. Use the CaptureSetting property to set the capture data resolution from the available ones. To set the best available capture settings prioritizing the frame rate, you could for example use the following:
Delphi:
procedure TForm1.SetMaxFrameRateClick(Sender: TObject); var
LSettings: TArray<TVideoCaptureSetting>;
- begin
CameraComponent1.CaptureSettingPriority := TVideoCaptureSettingPriority.FrameRate; LSettings := CameraComponent1.AvailableCaptureSettings; CameraComponent1.CaptureSetting := LSettings[0];
end;
C++:
void __fastcall TForm1::SetMaxFrameRateClick(TObject *Sender) {
DynamicArray<TVideoCaptureSetting> LSettings; CameraComponent1->CaptureSettingPriority = TVideoCaptureSettingPriority::FrameRate; LSettings = CameraComponent1->AvailableCaptureSettings; CameraComponent1->CaptureSetting = LSettings[0];
}
Note: When you set a specific CaptureSetting, the Quality property is automatically set to TVideoCaptureQuality.CaptureSettings.
- Type:
VideoCaptureQuality
- SampleBufferToBitmap(ABitmap: Bitmap, ASetSize: bool) None ¶
Displays the captured data on a bitmap. The SampleBufferToBitmap method displays the captured video data on a bitmap.
The ABitmap parameter is the bitmap where the image is displayed. The ASetSize parameter specifies whether the video samples are resized to fit the current size of ABitmap, or whether ABitmap is resized to the windows sizes.
- SetCaptureSetting(ASetting: VideoCaptureSetting) bool ¶
Setter of CaptureSetting.
- TorchMode¶
on, off, or auto. The TorchMode property can take one of three values enumerated by TTorchMode: ModeOff, ModeOn, and ModeAuto. For example, to turn on the torch of the CameraComponent1 TCameraComponent, you can use the following line:
Delphi:
CameraComponent.TorchMode := TTorchMode.ModeOn;
C++:
CameraComponent->TorchMode = TTorchMode::ModeOn;
Use the HasTorch property to see whether the camera device has a torch.
- Type:
TorchMode
- Type:
Selects the different modes for the torch