Signed-off-by: Laentir Valetov <laex@bk.ru>
This commit is contained in:
Laentir Valetov 2019-03-04 22:36:59 +04:00
parent ca879602f0
commit ed324db7f0

View File

@ -358,7 +358,9 @@ procedure TocvCameraSource.SetEnabled(Value: Boolean);
begin begin
if FEnabled <> Value then if FEnabled <> Value then
begin begin
if not(csDesigning in ComponentState) then if csDesigning in ComponentState then
FEnabled := Value
else
begin begin
if Assigned(FCapture) and FEnabled then if Assigned(FCapture) and FEnabled then
begin begin
@ -367,6 +369,7 @@ begin
cvReleaseCapture(FCapture); cvReleaseCapture(FCapture);
{$ENDIF} {$ENDIF}
FCapture := Nil; FCapture := Nil;
FEnabled := False;
end; end;
if Value then if Value then
begin begin
@ -385,10 +388,10 @@ begin
{$ENDIF} {$ENDIF}
(FSourceThread as TocvCaptureThread).Capture := FCapture; (FSourceThread as TocvCaptureThread).Capture := FCapture;
FSourceThread.Resume; FSourceThread.Resume;
FEnabled := True;
end; end;
end; end;
end; end;
FEnabled := Value;
end; end;
end; end;