MemoryArray(T) Class

FreeImage.NET

MemoryArrayT Class
Represents unmanaged memory, containing an array of a given structure.
Inheritance Hierarchy
SystemObject  FreeImageAPIMemoryArrayT
    FreeImageAPIPalette
    FreeImageAPIScanlineT

Namespace: FreeImageAPI
Assembly: FreeImageNET (in FreeImageNET.dll) Version: 3.17.0.4 (3.17.0)
Syntax
C#
public class MemoryArray<T> : IDisposable, 
	ICloneable, ICollection, IEnumerable<T>, IEnumerable, IEquatable<MemoryArray<T>>
where T : struct, new()

Type Parameters

T
Structuretype represented by the instance.

The MemoryArrayT type exposes the following members.

Constructors
  NameDescription
Protected methodMemoryArrayT
Initializes a new instance.
Public methodMemoryArrayT(IntPtr, Int32)
Initializes a new instance of the MemoryArrayT class.
Public methodMemoryArrayT(Void*, Int32)
Initializes a new instance of the MemoryArrayT class.
Top
Properties
  NameDescription
Public propertyBaseAddress
Gets the base address of the represented memory block.
Public propertyCount
Gets a 32-bit integer that represents the total number of elements in the MemoryArrayT.
Public propertyData
Gets or sets the values of the unmanaged array.
Public propertyIsSynchronized
Gets a value indicating whether access to the MemoryArrayT is synchronized (thread safe).
Public propertyItem
Gets or sets the value at the specified position in the array.
Public propertyLength
Gets the length of the unmanaged array.
Public propertySyncRoot
Gets an object that can be used to synchronize access to the MemoryArrayT.
Top
Methods
  NameDescription
Public methodClone
Creates a shallow copy of the MemoryArrayT.
Public methodCopyFrom
Copies a range of elements from the array starting at the specified sourceIndex and pastes them to the unmanaged array starting at the specified destinationIndex. The length and the indexes are specified as 32-bit integers.
Protected methodStatic memberCopyMemory
Copies a block of memory from one location to another.
Public methodCopyTo(Array, Int32)
Copies the entire array to a compatible one-dimensional Array, starting at the specified index of the target array.
Public methodCopyTo(T, Int32, Int32, Int32)
Copies a range of elements from the unmanaged array starting at the specified sourceIndex and pastes them to array starting at the specified destinationIndex. The length and the indexes are specified as 32-bit integers.
Public methodDispose
Releases all ressources.
Protected methodDispose(Boolean)
Releases allocated handles associated with this instance.
Protected methodEnsureNotDisposed
Throws an ObjectDisposedException if this instance is disposed.
Public methodEquals(Object)
Tests whether the specified MemoryArrayT structure is equivalent to this MemoryArrayT structure.
(Overrides ObjectEquals(Object).)
Public methodEquals(MemoryArrayT)
Tests whether the specified MemoryArrayT structure is equivalent to this MemoryArrayT structure.
Protected methodFinalize
Frees the allocated GCHandle.
(Overrides ObjectFinalize.)
Public methodGetEnumerator
Retrieves an object that can iterate through the individual elements in this MemoryArrayT.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Overrides ObjectGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetValue
Gets the value at the specified position.
Public methodGetValues
Gets the values at the specified position and length.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSetValue
Sets a value to the element at the specified position.
Public methodSetValues
Sets the values at the specified position.
Public methodToByteArray
Returns the represented block of memory as an array of Byte.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Tests whether two specified MemoryArrayT structures are equivalent.
Public operatorStatic memberInequality
Tests whether two specified MemoryArrayT structures are different.
Top
Fields
  NameDescription
Protected fieldbaseAddress
Baseaddress of the wrapped memory.
Protected fieldbuffer
Array of T containing a single element. The array is used as a workaround, because there are no pointer for generic types.
Protected fieldhandle
Handle for pinning buffer.
Protected fieldisFourBit
Indicates whther the wrapped memory is handles like 4-bit blocks.
Protected fieldisOneBit
Indicates whether the wrapped memory is handled like a bitfield.
Protected fieldlength
Number of elements being wrapped.
Protected fieldptr
Pointer to the element of buffer.
Protected fieldsyncRoot
An object that can be used to synchronize access to the MemoryArrayT.
Top
Remarks
Boolean and Char can not be marshalled.

Use Int32 instead of Boolean and Byte instead of Char.

See Also