Ejemplo n.º 1
0
        public void AddLicensePlateInfo(LicensePlateInfo licensePlateInfo)
        {
            var img       = licensePlateInfo.LoadImage();
            var ratio     = (float)img.Height / img.Width;
            var thumbNail = img.GetThumbnailImage(64, (int)(64 * ratio), null, IntPtr.Zero);

            img.Dispose();

            var lpin = new LicenseplateInfoWithThumbnail()
            {
                Thumbnail          = thumbNail,
                LicenseplateNumber = licensePlateInfo.LicensePlateNumber,
                CaptureTime        = licensePlateInfo.CaptureTime,
                Info = licensePlateInfo
            };


            if (InvokeRequired)
            {
                Action action = () => _licensePlates.Add(lpin);

                BeginInvoke(action);
                return;
            }

            _licensePlates.Add(lpin);
        }
        public void AddLicensePlateInfo(LicensePlateInfo licensePlateInfo)
        {
            var img = licensePlateInfo.LoadImage();
            var ratio = (float)img.Height / img.Width;
            var thumbNail = img.GetThumbnailImage(64, (int)(64 * ratio), null, IntPtr.Zero);
            img.Dispose();

            var lpin = new LicenseplateInfoWithThumbnail()
            {
                Thumbnail = thumbNail,
                LicenseplateNumber = licensePlateInfo.LicensePlateNumber,
                CaptureTime = licensePlateInfo.CaptureTime,
                Info = licensePlateInfo
            };

            if (InvokeRequired)
            {

                Action action = () => _licensePlates.Add(lpin);

                BeginInvoke(action);
                return;
            }

            _licensePlates.Add(lpin);
        }