[pascal]
if Switch1.IsChecked then begin
if CameraComponent1.HasFlash then
CameraComponent1.TorchMode := TTorchMode.tmModeOn;
end else begin
if CameraComponent1.HasFlash then
CameraComponent1.TorchMode := TTorchMode.tmModeOff;
end;
[/pascal]
5.回到Panel元件,設定Position的X ,下拉選擇 Create New TFloatAnimation
6.接著在SpeedButton 的 OnClick事件
[pascal]
var
FloatAnimationX: single;
begin
FloatAnimationX:=Self.ClientWidth – 60;
if (panel1.Position.X=FloatAnimationX) then begin
FloatAnimation1.StartValue:= FloatAnimationX;
FloatAnimation1.StopValue:= 0;
end
else begin
FloatAnimation1.StartValue:= 0;
FloatAnimation1.StopValue:= FloatAnimationX;
end;