public Bitmap ExportDarkBitMapImage() { if (!Connected) { return(null); } var t = new _FTRSCAN_IMAGE_SIZE(); ftrScanGetImageSize(device, out t); byte[] arr = new byte[t.nImageSize]; ftrScanGetDarkImage(device, arr); var b = new Bitmap(t.nWidth, t.nHeight); for (int x = 0; x < t.nWidth; x++) { for (int y = 0; y < t.nHeight; y++) { int a = 255 - arr[y * t.nWidth + x]; b.SetPixel(x, y, Color.FromArgb(a, a, a)); } } return(b); }
static extern bool ftrScanGetImageSize(IntPtr ftrHandle, out _FTRSCAN_IMAGE_SIZE pImageSize);