資源簡介
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;
????????}
????????/*******************************************
????????*?函數(shù)名稱:RotatePic???????
????????*?函數(shù)功能:旋轉(zhuǎn)圖片,目的是保存和顯示的圖片與按的指紋方向不同?????
????????*?函數(shù)入?yún)ⅲ築mpBuf---旋轉(zhuǎn)前的指紋字符串
????????*?函數(shù)出參:ResBuf---旋轉(zhuǎn)后的指紋字符串
????????*?函數(shù)返回:無
????????*********************************************/
????????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?????????????????{
????????????????????for?(ColLoop?=?0;?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();
????????????}
????????}
????????/*******************************************
????????*?函數(shù)名稱:StructToBytes???????
????????*?函數(shù)功能:將結(jié)構(gòu)體轉(zhuǎn)化成無符號字符串?dāng)?shù)組?????
????????*?函數(shù)入?yún)ⅲ篠tructObj---被轉(zhuǎn)化的結(jié)構(gòu)體
????????*???????????Size---被轉(zhuǎn)化的結(jié)構(gòu)體的大小
????????*?函數(shù)出參:無
????????*?函數(shù)返回:結(jié)構(gòu)體轉(zhuǎn)化后的數(shù)組
????????*********************************************/
????????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個文件信息
- 上一篇:c#語言實現(xiàn)K短路算法
- 下一篇:基于pcan-basic編譯的上位機
評論
共有 條評論