Locks the data of the image to directly access the bytes of the image
This locks the data to read and write to directly using unsafe pointers. After reading or updating the data, you must call BitmapData.Dispose() to unlock the data before using the bitmap. e.g.: using (var bd = bitmap.Lock ()) { byte* pdata = bd.Data; // access data }