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.4.0.9.0.377 (.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
  NameDescription
Public methodDispose
Disposes the ResourceReleaser.
(Inherited from ResourceReleaserT.)
Protected methodDispose(Boolean)
Releases unmanaged and - optionally - managed resources.
(Inherited from ResourceReleaserT.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize (Inherited from ResourceReleaserT.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
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