static extern bool ftrScanGetImageSize(IntPtr ftrHandle, out _FTRSCAN_IMAGE_SIZE pImageSize);
static void Main(string[] args) { var ptr = ftrScanOpenDevice(); Console.WriteLine(ptr); bool green = true; bool red = true; bool i = ftrScanGetDiodesStatus(ptr, out green, out red); i = ftrScanSetDiodesStatus(ptr, (byte)255, (byte)255); i = ftrScanSetDiodesStatus(ptr, (byte)0, (byte)0); var t = new _FTRSCAN_IMAGE_SIZE(); i = ftrScanGetImageSize(ptr, out t); byte[] arr = new byte[t.nImageSize]; i = ftrScanGetImage(ptr, 4, arr); i = ftrScanCloseDevice(ptr); 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)); } b.Save("D:\\finger.bmp"); Console.ReadKey(); }
public Bitmap ExportBitMap() { if (!Connected) return null; var t = new _FTRSCAN_IMAGE_SIZE(); ftrScanGetImageSize(device, out t); byte[] arr = new byte[t.nImageSize]; ftrScanGetImage(device, 4, 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 void Main(string[] args) { var ptr = ftrScanOpenDevice(); Console.WriteLine(ptr); bool green = true; bool red = true; bool i = ftrScanGetDiodesStatus(ptr, out green, out red); i = ftrScanSetDiodesStatus(ptr, (byte)255, (byte)255); i = ftrScanSetDiodesStatus(ptr, (byte)0, (byte)0); var t = new _FTRSCAN_IMAGE_SIZE(); i = ftrScanGetImageSize(ptr, out t); byte[] arr = new byte[t.nImageSize]; i = ftrScanGetImage(ptr, 4, arr); i = ftrScanCloseDevice(ptr); 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)); } } b.Save("D:\\finger.bmp"); Console.ReadKey(); }
public Bitmap ExportBitMap() { if (!Connected) { return(null); } var t = new _FTRSCAN_IMAGE_SIZE(); ftrScanGetImageSize(device, out t); byte[] arr = new byte[t.nImageSize]; ftrScanGetImage(device, 4, 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); }