temu客户端程序
This commit is contained in:
commit
4aaf264e89
694 files changed
+263780
No files matched your search
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using ZXing;
|
||||
|
||||
namespace AllBase
|
||||
{
|
||||
public class ImageErWeiMa
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否二维码
|
||||
/// </summary>
|
||||
/// <param name="strSavePath"></param>
|
||||
/// <returns></returns>
|
||||
public bool GetErWeiMa(byte[] file, out int width, out int height, out Image initImage)
|
||||
{
|
||||
initImage = null;
|
||||
width = 0;
|
||||
height = 0;
|
||||
try
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(file);
|
||||
initImage = Image.FromStream(ms);
|
||||
ms.Close();
|
||||
width = initImage.Width;
|
||||
height = initImage.Height;
|
||||
if (initImage.Width < 10 || initImage.Height < 10)
|
||||
{
|
||||
initImage = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
BarcodeReader reader = new BarcodeReader();
|
||||
Result result = reader.Decode((Bitmap)initImage);
|
||||
if (result == null || string.IsNullOrEmpty(result.Text))
|
||||
{
|
||||
reader = null;
|
||||
result = null;
|
||||
//initImage = null;
|
||||
return false;
|
||||
}
|
||||
reader = null;
|
||||
result = null;
|
||||
initImage = null;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user