CrystalMpq.DataFormats.Surface.Lock C# (CSharp) Méthode

Lock() public méthode

Locks the surface for direct read/write access.
Unlock must be called once direct buffer access is not needed anymore. Forgetting to unlock a locked surface is likely to prevent the buffer from being disposed, thus causing a memory leak. Neither Dispose nor Finalize will unlock the surface, for safety reasons.
public Lock ( ) : SurfaceData
Résultat SurfaceData
        public SurfaceData Lock()
        {
            if (locked) throw new InvalidOperationException();

            int stride;
            var dataPointer = LockInternal(out stride);

            locked = true;

            return new SurfaceData(Width, Height, dataPointer, stride);
        }