0

I am modifying a large bitmap using BitmapData, LockBits, unsafe and byte*. Absolutely no problem about that.
I would like to display the operation progress in a Label control but, quite obviously, it is not repainted. If I add Application.DoEvents() to force repainting I get the error "Bitmap region is already locked".
Is there another way of doing that?

Paulo Barretto
  • 155
  • 1
  • 10
  • 1
    Do the bitmap manipulation on a background worker thread, then the GUI thread will remain responsive. – Cee McSharpface Oct 21 '18 at 13:38
  • So, if I update the Label text in that background thread, it will be repainted? – Paulo Barretto Oct 21 '18 at 14:16
  • to be precise, if you update the label text *from the background thread using invoke*, it will be repainted. [more info here](https://stackoverflow.com/q/661561/1132334). If you included relevant code in your post, it will be easier to diagnose and fix that reentrance bug "...is already locked". – Cee McSharpface Oct 21 '18 at 14:53

0 Answers0