Это старый способ:
Код: Выделить всё
BarcodeReader br = new BarcodeReader();
string text = br.Decode(bmpFile).ToString();
Ошибка, с которой я столкнулся:
Код: Выделить всё
CS0305 Using the generic type 'BarcodeReader' requires 1 type arguments
Код: Выделить всё
var reader = new MultiFormatReader();
Код: Выделить всё
var hints = new Dictionary
{
{ DecodeHintType.POSSIBLE_FORMATS, new List {
BarcodeFormat.QR_CODE,
BarcodeFormat.CODE_39,
BarcodeFormat.CODE_128,
BarcodeFormat.EAN_13,
BarcodeFormat.EAN_8,
BarcodeFormat.UPC_A,
BarcodeFormat.UPC_E,
BarcodeFormat.All_1D,
BarcodeFormat.QR_CODE,
BarcodeFormat.ITF,
BarcodeFormat.CODABAR
}},
{ DecodeHintType.TRY_HARDER, true }
};
reader.decode(binaryBitmap, hints);
Может ли кто-нибудь помочь мне решить эту проблему в .NET 8? Я думаю, проблема связана с .net8.0
Заранее спасибо,
J
Подробнее здесь: https://stackoverflow.com/questions/786 ... sing-zxing