pirate004
pirate004

Reputation: 21

Getting the image from fingerprint device using C#

I am using C# to implement JKFinger SDK into our office project and I am new to C#. There are two methods in SDK, PrintImageAt() which is drawing image into PictureBox And GetFingerImage() get the last captured image by device in bmp format.

Graphics g = pictureBox1.CreateGraphics();
int dc = g.GetHdc().ToInt32();
axZKFPEngX1.PrintImageAt(dc, 0, 0, axZKFPEngX1.ImageWidth, axZKFPEngX1.ImageHeight);
object obj = null;
axZKFPEngX1.GetFingerImage(ref obj);

Now I want to store the captured image into database. The PictureBox is displaying the images but not initializing with it. For getting image from PictureBox is returning null. And for GetFingerPrint(ref obj) is returning an object but can't be converted to Bitmap. I want to know how to get that image.

Upvotes: 1

Views: 1358

Answers (1)

pirate004
pirate004

Reputation: 21

GetFingerPrint(ref obj) Is returning System.Byte[] Object.

axZKFPEngX1.GetFingerImage(ref obj);
byte[] data = (byte[])obj;
MemoryStream ms = new MemoryStream(data);
Image image = Image.FromStream(ms);

Upvotes: 1

Related Questions