这个问题参考API文档链接,http://www.blackberry.com/developers/docs/7.0.0api/net/rim/device/api/barcodelib/BarcodeBitmap.html http://www.blackberry.com/developers/docs/7.0.0api/net/rim/device/api/barcodelib/BarcodeBitmap.html
他们指定旧方法
public static Bitmap createBitmap(ByteMatrix byteMatrix,
int maxBitmapSizeInPixels)
已弃用。
但通过使用新方法,
public static Bitmap createBitmap(ByteMatrix byteMatrix)
他们没有指定一种方法来指定 Multiformatwriter 中 QR 码的纠错级别。我也没有找到办法,查看了各种成员函数。
有人试过这个吗?
感谢您的帮助。
这是我的代码,我已经用我的手机检查过,纠错级别根据我的手机设置正确。
Hashtable hints = new Hashtable();
switch (comboBox1.Text)
{
case "L":
hints.Add(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L);
break;
case "Q":
hints.Add(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.Q);
break;
case "H":
hints.Add(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
break;
default:
hints.Add(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M);
break;
}
MultiFormatWriter mw = new MultiFormatWriter();
ByteMatrix bm = mw.encode(data, BarcodeFormat.QR_CODE, size, size, hints);
Bitmap img = bm.ToBitmap();
pictureBox1.Image = img;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)