• 大小: 2.45M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-05-03
  • 语言: C#
  • 标签: demo  20  C#  指纹  

资源简介

C#对接中控指纹仪live20r Demo

资源截图

代码片段和文件信息

using System;
using System.Runtime.InteropServices;
using System.IO;

namespace Sample
{
    public class BitmapFormat
    {
        public struct BITMAPFILEHEADER
        {
            public ushort bfType;
            public int bfSize;
            public ushort bfReserved1;
            public ushort bfReserved2;
            public int bfOffBits;
        }

        public struct MASK
        {
            public byte redmask;
            public byte greenmask;
            public byte bluemask;
            public byte rgbReserved;
        }

        public struct BITMAPINFOHEADER
        {
            public int biSize;
            public int biWidth;
            public int biHeight;
            public ushort biPlanes;
            public ushort biBitCount;
            public int biCompression;
            public int biSizeImage;
            public int biXPelsPerMeter;
            public int biYPelsPerMeter;
            public int biClrUsed;
            public int biClrImportant;
        }

        /*******************************************
        * 函数名称:RotatePic       
        * 函数功能:旋转图片,目的是保存和显示的图片与按的指纹方向不同     
        * 函数入参:BmpBuf---旋转前的指纹字符串
        * 函数出参:ResBuf---旋转后的指纹字符串
        * 函数返回:无
        *********************************************/
        public static void RotatePic(byte[] BmpBuf int width int height ref byte[] ResBuf)
        {
            int RowLoop = 0;
            int ColLoop = 0;
            int BmpBuflen = width * height;

            try
            {
                for (RowLoop = 0; RowLoop < BmpBuflen; )
                {
                    for (ColLoop = 0; ColLoop < width; ColLoop++)
                    {
                        ResBuf[RowLoop + ColLoop] = BmpBuf[BmpBuflen - RowLoop - width + ColLoop];
                    }

                    RowLoop = RowLoop + width;
                }
            }
            catch (Exception ex)
            {
                //ZKCE.SysException.ZKCELogger logger = new ZKCE.SysException.ZKCELogger(ex);
                //logger.Append();
            }
        }

        /*******************************************
        * 函数名称:StructToBytes       
        * 函数功能:将结构体转化成无符号字符串数组     
        * 函数入参:StructObj---被转化的结构体
        *           Size---被转化的结构体的大小
        * 函数出参:无
        * 函数返回:结构体转化后的数组
        *********************************************/
        public static byte[] StructToBytes(object StructObj int Size)
        {
            int StructSize = Marshal.SizeOf(StructObj);
            byte[] GetBytes = new byte[StructSize];

            try
            {
                IntPtr StructPtr = Marshal.AllocHGlobal(StructSize);
                Marshal.StructureToPtr(StructObj StructPtr false);
                Marshal.Copy(StructPtr GetBytes 0 StructSize);
                Marshal.FreeHGlobal(StructPtr);

                if (Size == 14)
                {
         

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-12-09 22:02  bin\
     目录           0  2019-08-28 16:31  bin\ASYNC\
     目录           0  2020-12-09 22:05  bin\csdnmjfxzq2019\
     文件     2375680  2020-05-25 18:08  bin\csdnmjfxzq2019\csdn_v5.5.exe
     目录           0  2020-04-07 12:33  bin\csdnmjfxzq2019\Skin\
     文件      100933  2020-04-07 12:33  bin\csdnmjfxzq2019\SkinH_EL.dll
     文件       17926  2020-04-07 12:33  bin\csdnmjfxzq2019\Skin\1.she
     目录           0  2016-12-06 10:26  bin\Debug\
     目录           0  2019-08-28 16:31  bin\GOLD\
     目录           0  2019-08-28 16:31  bin\Release\
     目录           0  2019-08-28 16:31  bin\STD_IMAGE\
     目录           0  2019-08-28 16:31  bin\TRAIL\
     目录           0  2019-08-28 16:31  bin\TRAIL_ASYNC\
     目录           0  2020-12-09 20:57  bin\x64\
     目录           0  2019-08-28 16:31  bin\x64\ASYNC\
     目录           0  2019-08-28 16:31  bin\x64\GOLD\
     目录           0  2019-08-28 16:31  bin\x64\STD_IMAGE\
     目录           0  2019-08-28 16:31  bin\x64\TRAIL\
     目录           0  2019-08-28 16:31  bin\x64\TRAIL_ASYNC\
     目录           0  2020-12-09 20:57  bin\x86\
     目录           0  2019-08-28 16:31  bin\x86\ASYNC\
     目录           0  2019-08-28 16:31  bin\x86\GOLD\
     目录           0  2019-08-28 16:31  bin\x86\STD_IMAGE\
     目录           0  2019-08-28 16:31  bin\x86\TRAIL\
     目录           0  2019-08-28 16:31  bin\x86\TRAIL_ASYNC\
     文件       11439  2016-09-17 13:45  BitmapFormat.cs
     文件       10693  2019-07-16 11:27  Demo2.csproj
     文件        4533  2019-07-16 11:27  Demo2.sln
     文件       19456  2018-06-04 11:17  Demo2.suo
     文件       45056  2019-12-27 11:02  Demo2.v12.suo
     文件       11107  2016-12-08 10:49  Form1.cs
............此处省略83个文件信息

评论

共有 条评论