Locks the data for reading and writing access. Sends an error to the console if the image is not locked when reading or writing a pixel.
public void Lock()