From 5b90cee75b34a107640f6715db1264c2c927d169 Mon Sep 17 00:00:00 2001 From: DucDangAnh Date: Mon, 29 Jun 2020 16:06:56 +0700 Subject: [PATCH] LaneIn - Add Method: ClearPlateAndOverviewImage --- AIParkingApplication/LaneIn.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/AIParkingApplication/LaneIn.cs b/AIParkingApplication/LaneIn.cs index bbed15d..eca0bd3 100644 --- a/AIParkingApplication/LaneIn.cs +++ b/AIParkingApplication/LaneIn.cs @@ -60,6 +60,7 @@ namespace AIParkingApplication private async void C3Device_OnNewCardReceived(int doorId, string cardNumber) { + ClearPlateAndOverviewImage(); var cardInfoResult = await apiController.GetCardInformation(cardNumber); if (cardInfoResult.IsValid) { @@ -141,6 +142,21 @@ namespace AIParkingApplication })); } + private void ClearPlateAndOverviewImage() + { + pictureBoxPlateImage.Invoke(new Action(() => + { + pictureBoxPlateImage.Image?.Dispose(); + pictureBoxPlateImage.Image = null; + })); + + pictureBoxOverviewImage.Invoke(new Action(() => + { + pictureBoxOverviewImage.Image?.Dispose(); + pictureBoxOverviewImage.Image = null; + })); + } + private void OpenDoor(int doorId) { if (c3Device.OpenDoor(doorId).HasError)