LaneIn - Add Method: ClearPlateAndOverviewImage

This commit is contained in:
DucDangAnh 2020-06-29 16:06:56 +07:00
parent 0d5e76b2af
commit 5b90cee75b

View File

@ -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)