public FingerTemplate Extract(FingerImage image) { var imageSG = image as FingerImageSG; if (imageSG == null) { return(null); } int quality = 0; TemplateSG tmpl = new TemplateSG(_BSPCode); tmpl.Bytes = new byte[maxTemplateSize]; tmpl.info = FingerInfoTemplate; m_FPM.GetImageQuality(imageSG.Width, imageSG.Height, imageSG.RawData, ref quality); tmpl.info.ImageQuality = (short)quality; m_FPM.SetTemplateFormat(SGFPMTemplateFormat.ANSI378); m_FPM.CreateTemplate(tmpl.info, imageSG.RawData, tmpl.Bytes); m_FPM.GetTemplateSize(tmpl.Bytes, ref tmpl.size); return(tmpl); }