【发布时间】:2014-08-07 19:52:52
【问题描述】:
我使用 imageAvailable 事件从相机获取位图(每 1 秒 25 个)。我必须在 GUI 上显示它并处理该位图。所以我使用了两个位图,一个用于实时,另一个用于处理。 问题是我在处理“currentFrame2”时收到了 invalidOperationException(它说“对象目前正在其他地方使用”)。直播我用的是“currentFrame”,也没问题。
currentFrame = (Bitmap)e.ImageBuffer.Bitmap.Clone();
currentFrame2 = currentFrame;
我在看
- Bitmap.Save "Object is currently in use elsewhere" Threading Issue
- Accessing an object on 2 threads at the same time
以上链接无济于事。
请给我一个解决这个问题的建议。
谢谢
【问题讨论】:
标签: c# concurrency bitmap invalidoperationexception