This commit is contained in:
clowwindy
2015-01-13 01:51:51 +08:00
parent 0f1aff24a5
commit dce38883a5
@@ -8,6 +8,8 @@ using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ZXing;
using ZXing.Common;
using ZXing.QrCode;
namespace Shadowsocks.View
{
@@ -387,15 +389,10 @@ namespace Shadowsocks.View
cropRect,
GraphicsUnit.Pixel);
}
var reader = new BarcodeReader
{
TryHarder = true,
PossibleFormats = new List<BarcodeFormat>
{
BarcodeFormat.QR_CODE
}
};
var result = reader.Decode(target);
var source = new BitmapLuminanceSource(target);
var bitmap = new BinaryBitmap(new HybridBinarizer(source));
QRCodeReader reader = new QRCodeReader();
var result = reader.decode(bitmap);
if (result != null)
{
var success = controller.AddServerBySSURL(result.Text);