protected override void worker_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                var fps = new List <Fingerprint>();

                uint count = _fourprint.GetSegmentationCount(e.Argument as Image);
                using (Dermalog.Afis.ImageContainer.Decoder decoder = new Dermalog.Afis.ImageContainer.Decoder())
                    for (uint i = 0; i < count; i++)
                    {
                        SegmentedFingerprint finger = _fourprint.GetSegmentedFingerprint(i);
                        fps.Add(ProcessImage(finger.Image, finger.ImageData, finger.Position, finger.Hand));
                    }

                SetAllFingerLeds(LF10LedColor.OFF);

                uint[] positions = new uint[fps.Count];
                for (int i = 0; i < positions.Length; i++)
                {
                    positions[i] = fps[i].Position;
                }
                SetLeds(fps[0].Hand, positions, LF10LedColor.GREEN);

                base.InvokeFingerprintsDetected(fps);
            }
            catch (Exception ex)
            {
                InvokeScannerError(sender, new ScannerErrorEventArgs("Processing error: " + ex.Message, ex));
            }
        }
 protected Fingerprint ProcessImage(System.Drawing.Image img, byte[] rawData, uint fingerPosition = 0, Dermalog.AFIS.FourprintSegmentation.HandPositions hand = Dermalog.AFIS.FourprintSegmentation.HandPositions.Unknown)
 {
     using (Dermalog.Afis.ImageContainer.Decoder decoder = new Dermalog.Afis.ImageContainer.Decoder())
     {
         using (RawImage rawImage = decoder.Decode(rawData))
         {
             return(ProcessImage(img, rawImage, fingerPosition, hand));
         }
     }
 }