BitmapData
has a property called Reserved
, which returns a 32-bit signed
integer
. Microsoft's documentation says not to use this property. If we shouldn't use it; then why is it there? What exactly is it for?
Reserved fields and properties can have a variety of uses. One fairly common usage is to allow for the possibility that more sophisticated types of BitmapData may in future need to store some type of information for which the present structure makes no provision. If nobody has used the Reserved field for anything, future implementations could use that field to hold a pointer or handle to another structure containing additional information.
Interesting, that's a bug. It is actually an IntPtr, you can tell from the native declaration, GdiPlusImaging.h header file in the SDK (c:\program files\microsoft sdks\windows\v6.0a\include directory for VS2008). The bug doesn't byte because GDI+ creates the instance of it.
Which makes it likely that the field stores a pointer or a handle. I would guess at the memory mapped file object handle. Cheaper to store it in the client state object over having to maintain a dictionary to find it back in the UnlockBits() function. Don't mess with it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With