Click or drag to resize

PixelMemoryLocker Class

PixelMemoryLocker is a utility class to help manage the locking and unlocking of memory. By constructing a PixelMemoryLocker object in a using block, PixelMemory will be automatically locked on entrance and exit of the block.
Inheritance Hierarchy
SystemObject
  Atalasoft.ImagingResourceReleaserPixelMemory
    Atalasoft.Imaging.MemoryPixelMemoryLocker

Namespace:  Atalasoft.Imaging.Memory
Assembly:  Atalasoft.dotImage (in Atalasoft.dotImage.dll) Version: 11.0.0.0.0.297 (.NET 4.5.2, x86)
Syntax
public class PixelMemoryLocker : ResourceReleaser<PixelMemory>

The PixelMemoryLocker type exposes the following members.

Constructors
  NameDescription
Public methodPixelMemoryLocker(AtalaImage)
Constructs an object that will automatically lock and unlock the PixelMemory for the supplied AtalaImage.
Public methodPixelMemoryLocker(PixelMemory)
Constructs an object that will automatically lock and unlock the supplied PixelMemory.
Top
Methods
Fields
Remarks
PixelMemoryLocker should never be used outside of a using block. PixelMemoryLocker depends on Dispose being called in a predictable manner to operate correctly. Using a PixelMemoryLocker outside a using block will cause unpredictable behavior since the memory will be unlocked when the object is either disposed or garbage collected.
Examples
C#
using (PixelMemoryLocker locker = new PixelMemoryLocker(myImage)) {
    PerformDirectMemoryAccess(myImage);
}
See Also