Click or drag to resize

TwainMemory Class

This class represents a memory object passed into TWAIN or returned from TWAIN.
Inheritance Hierarchy
SystemObject
  Atalasoft.TwainTwainMemory

Namespace:  Atalasoft.Twain
Assembly:  Atalasoft.DotTwain (in Atalasoft.DotTwain.dll) Version: 11.0.0.0.0.297 (.NET 4.5.2, x86)
Syntax
public sealed class TwainMemory : IDisposable

The TwainMemory type exposes the following members.

Properties
  NameDescription
Public propertyIsLocked
Gets a value indicating whether the memory is currently locked.
Public propertyMemorySize
Gets the size of the memory in bytes.
Public propertyPointer
Gets the pointer of the memory. If the TwainMemory is locked, this will return the locked pointer.
Public propertyPosition
Gets or sets the current position within the memory.
Top
Methods
  NameDescription
Public methodCode exampleAllocate
Call this method to allocate memory for this object. If memory has already been allocated, it will be released before allocation new memory.
Public methodCopy(Byte, IntPtr)
Copies data from a pointer into a byte array.
Public methodCopy(IntPtr, Byte)
Copies a byte array into a pointer.
Public methodCopy(IntPtr, IntPtr, Int32)
Copies memory from one pointer to another.
Public methodCreate
Returns a new TwainMemory object with no memory allocated.
Public methodCreate(IntPtr)
Creates a new TwainMemory object for a pointer returned from TWAIN.
Public methodDispose
Releases the memory used by the object.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Called by .NET when the object is being destroyed.
(Overrides ObjectFinalize.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodLock
Locks the moveable memory for read / write operations.
Public methodReadBoolean
Reads a TW_BOOL from the current Position and advances the position.
Public methodReadBoolean(Int64)
Reads a TW_BOOL from the specified memory offset.
Public methodReadInt16
Reads a TW_INT16 from the current Position and advances the position.
Public methodReadInt16(Int64)
Reads a TW_INT16 from the specified memory offset.
Public methodReadInt32
Reads a TW_INT32 from the current Position and advances the position.
Public methodReadInt32(Int64)
Reads a TW_INT32 from the specified memory offset.
Public methodReadInt8
Reads a TW_INT8 from the current Position and advances the position.
Public methodReadInt8(Int64)
Reads a TW_INT8 from the specified offset.
Public methodReadIntPtr
Reads a TW_HANDLE from the current Position and advances the position.
Public methodReadIntPtr(Int64)
Reads a TW_HANDLE from the specified memory offset.
Public methodReadString(TwainItemType)
Reads a TW_STR32, TW_STR64, TW_STR128, TW_STR255, TW_STR1024 or TW_UNI512 from the current Position and advances the position.
Public methodReadString(TwainItemType, Int64)
Reads a TW_STR32, TW_STR64, TW_STR128, TW_STR255, TW_STR1024 or TW_UNI512 from the specified memory offset.
Public methodReadStructure(Type)
Reads a structure from the current Position and advances the position by the structure memory size.
Public methodReadStructure(Type, Int64)
Reads a structure from the specified memory offset.
Public methodReadTwainMemory
Reads a TW_HANDLE from the current Position and advances the position.
Public methodReadTwainMemory(Int64)
Reads a TW_HANDLE from the specified memory offset.
Public methodReadUInt16
Reads a TW_UINT16 from the current Position and advances the position.
Public methodReadUInt16(Int64)
Reads a TW_UINT16 from the specified memory offset.
Public methodReadUInt32
Reads a TW_UINT32 from the current Position and advances the position.
Public methodReadUInt32(Int64)
Reads a TW_UINT32 from the specified memory offset.
Public methodReadUInt8
Reads a TW_UINT8 from the current Position.
Public methodReadUInt8(Int64)
Reads a TW_UINT8 from the specified offset.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUnlock
Unlocks the moveable memory when finished reading or writing.
Public methodWrite(Byte)
Writes a byte array into the memory at the current Position and advances the position.
Public methodWrite(Byte, Int64)
Writes a byte array into the memory at the specified memory offset.
Public methodWriteBoolean(Boolean)
Writes a TW_BOOL into the memory at the current Position and advances the position.
Public methodWriteBoolean(Boolean, Int64)
Writes a TW_BOOL to memory at the specified memory offset.
Public methodWriteInt16(Int16)
Writes a TW_INT16 into the memory at the current Position and advances the position.
Public methodWriteInt16(Int16, Int64)
Writes a TW_INT16 to memory at the specified memory offset.
Public methodWriteInt32(Int32)
Writes a TW_INT32 into the memory at the current Position and advances the position.
Public methodWriteInt32(Int32, Int64)
Writes a TW_INT32 to memory at the specified memory offset.
Public methodWriteInt8(SByte)
Writes a TW_INT8 to the memory at the current Position.
Public methodWriteInt8(SByte, Int64)
Writes a TW_INT8 to the specified offset.
Public methodWriteIntPtr(IntPtr)
Writes a TW_HANDLE into the memory at the current Position and advances the position.
Public methodWriteIntPtr(IntPtr, Int64)
Writes a TW_HANDLE to memory at the specified memory offset.
Public methodWriteString(String, TwainItemType)
Writes a TW_STR32, TW_STR64, TW_STR128, TW_STR255, TW_STR1024 or TW_UNI512 into memory at the current position and advances the position.
Public methodWriteString(String, TwainItemType, Int64)
Writes a TW_STR32, TW_STR64, TW_STR128, TW_STR255, TW_STR1024 or TW_UNI512 into memory at the specified offset.
Public methodWriteStructure(Object)
Writes a structure into the memory at the current Position and advances the position.
Public methodWriteStructure(Object, Int64)
Writes a structure to memory at the specified memory offset.
Public methodWriteUInt16(UInt16)
Writes a TW_UINT16 into the memory at the current Position and advances the position.
Public methodWriteUInt16(UInt16, Int64)
Writes a TW_UINT16 to memory at the specified memory offset.
Public methodWriteUInt32(UInt32)
Writes a TW_UINT32 into the memory at the current Position and advances the position.
Public methodWriteUInt32(UInt32, Int64)
Writes a TW_UINT32 to memory at the specified memory offset.
Public methodWriteUInt8(Byte)
Writes a TW_UINT8 to the current Position.
Public methodWriteUInt8(Byte, Int64)
Writes a TW_UINT8 to the specified offset.
Top
Remarks
This class is provided as a parameter for ITwainDataStructure methods, allowing objects passed into the SendCommand(TwainTriplet, TwainIdentity, ITwainDataStructure) methods to be written or read.
Examples
ITwainDataStructure Interface
See Also