1

If I have the below code, everything will work - no exceptions.

_imgOutput.Bitmap = _irViewAreaBitmap;
ibxOutput.Image = _imgOutput;

If instead of the above I did this (with everything else the same):

pictureBox1.Image = _irViewAreaBitmap;

I get an "InvalidOperationException: Object currently ...".

I am confused because I would think both codes would try to access the _irViewAreaBitmap at the same time, one can use it successfully, while the other cannot!

Thanks!

Aishwar
  • 9,284
  • 10
  • 59
  • 80
  • @aip similar question which might be helpful for u http://stackoverflow.com/questions/1851292/invalidoperationexception-object-is-currently-in-use-elsewhere – ACP Feb 22 '10 at 07:10
  • @Pandiya: leaving aside the part about threads - the two code segements above run at the same spot - but one causes the exception, and the other does not! Both of them do access the bitmap. I am just wondering why does this happen (one fails, the other one is okay). – Aishwar Feb 22 '10 at 16:13

0 Answers0