如何解决抛出异常:System.Drawing.dll 中的“System.ArgumentException”
我使用网络摄像头获取位图图像并生成二维码。然后将其传入“QRLiveBox”的图片框。
Result result = barcodeReader.Decode(new Bitmap(QRLiveBox.Image as Bitmap));
if (QRLiveBox.Image != null)
{
BarcodeReader barcodeReader = new BarcodeReader();
//Result result = barcodeReader.Decode((Bitmap)QRLiveBox.Image);
Result result = barcodeReader.Decode(new Bitmap(QRLiveBox.Image as Bitmap));
if (result != null)
{
string qrResult = result.ToString();
txtDecodedQRCode.Text = qrResult;
//captureDevice.Stop();
}
}
你们认为问题或解决方案。以及如何编码。
- 两个线程是否不能同时访问位图?
- 是不是接口有问题?
- 如何在不使用 Control.Invoke 的情况下访问任何控件?
我在这里找到了线索:
- Best Way to Invoke Any Cross-Threaded Code?
- InvalidOperationException - object is currently in use elsewhere
但我不知道如何在我的项目中实现它。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。