Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does it actually mean by "Bitmap locking"?

The MSDN says that:

Locks a Bitmap into system memory.

nothing much is explained.

  • What does it actually mean by "Bitmap locking"?

  • How do locking work in the memory?

  • What is the benefit of locking?

like image 899
user366312 Avatar asked Jan 25 '26 08:01

user366312


1 Answers

It locks the bitmap image (which was not directly accessable except indirectly via the Bitmap class to a memory area so that the you can have direct access to the memory of the image - that is read/write to the image memory directly using a pointer to it.

You might want to do that if you had to manipulate the image in a way that would be faster by direct access rather than read/writepexel, drawline etc.

After locking it, you need to remeber to unlock it.

See the remarks and examples of this MSDN page https://msdn.microsoft.com/en-us/library/5ey6h79d%28v=vs.110%29.aspx

like image 184
lostbard Avatar answered Jan 28 '26 22:01

lostbard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!