CameraComponent¶
Qualified name: delphifmx.CameraComponent
- class CameraComponent¶
Bases:
FmxObjectMethods
TCameraComponent.GetAvailableCaptureSettings(ACanvasClass: CanvasClass) -> tuple Returns an array of available video capture settings.
Getter of CaptureSetting.
It returns the available capture settings.
TCameraComponent.SampleBufferToBitmap(ABitmap: Bitmap, ASetSize: bool) -> None Displays the captured data on a bitmap.
TCameraComponent.SetCaptureSetting(ASetting: VideoCaptureSetting) -> bool Setter of CaptureSetting.
Attributes
ActionClientSpecifies 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.
ChildrenStores an array of children attached to this parent component.
ChildrenCountRead-only property that specifies the number of children in the children list.
ClassNameReturns the TObject.ClassName
ComObjectSpecifies the interface reference implemented by the component.
ComponentCountReturns the owned component count
ComponentIndexIndicates the position of the component in its owner's Components property array.
ComponentStateDescribes the current state of the component, indicating when a component needs to avoid certain actions.
ComponentStyleGoverns the behavior of the component.
ComponentsReturns an iterator over the owned components
DataStores a Tvalue, which is a data structure that can store different kinds of data types.
DesignInfoContains 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.
IndexSpecifies the index of the child object in the children array attached to this object.
default, front, or back camera.
NameSpecifies the name of the component as referenced in code.
ObserversIndicates the TObservers object added to the TComponent.
OwnerReturns the Component Owner
ParentReturns/Sets the Control Visibility
States the quality of the video capture.
RootSpecifies the root parent of this object.
StoredSpecifies whether this object is stored in the .XFM file.
StyleNameSpecifies the style name for this FMX component.
TagStores a NativeInt integral value as a part of a component.
TagFloatCustom property that stores any floating-point value.
TagObjectCustom property that stores any object value.
TagStringCustom property that stores any string value.
on, off, or auto.
VCLComObjectRepresents 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