private void saveFileDialog1_FileOk(object sender, CancelEventArgs e) { GrCaptureImageFormat imformat = new GrCaptureImageFormat(); switch (saveFileDialog1.FilterIndex) { case 1: { imformat = GrCaptureImageFormat.GRCAP_IMAGE_FORMAT_BMP; } break; } try { fingerPrint.SaveRawImageToFile(rawImage, saveFileDialog1.FileName, imformat); } catch { } }
public void SaveRawImageToFile(FingerprintRawImage rawImage, string fileName, GrCaptureImageFormat imageFormat) { try { IntPtr destination = Marshal.AllocCoTaskMem(rawImage.Width * rawImage.Height); Marshal.Copy(rawImage.RawImage, 0, destination, rawImage.Width * rawImage.Height); this.SaveRawImageToFile(destination, rawImage.Width, rawImage.Height, fileName, imageFormat); Marshal.FreeCoTaskMem(destination); } catch (OutOfMemoryException exception) { FingerprintException exception2 = new FingerprintException(-7, exception); throw exception2; } }
private void SaveRawImageToFile(IntPtr rawimage, int width, int height, string fileName, GrCaptureImageFormat imageFormat) { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrCapSaveRawImageToFile(rawimage, width, height, fileName, imageFormat); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-7, exception); throw exception2; } FingerprintException.CheckError(errorCode); }
private void saveFileDialog1_FileOk(object sender, CancelEventArgs e) { GrCaptureImageFormat imformat = new GrCaptureImageFormat(); switch(saveFileDialog1.FilterIndex) { case 1:{imformat = GrCaptureImageFormat.GRCAP_IMAGE_FORMAT_BMP; }break; } try { fingerPrint.SaveRawImageToFile(rawImage, saveFileDialog1.FileName, imformat); } catch { } }
public static extern int GrCapSaveRawImageToFile([In] IntPtr rawimage, int width, int height, string fileName, GrCaptureImageFormat imageFormat);