Click or drag to resize
SoBufferObjectMemset Method (IntPtr, UInt64, UInt64, UInt64)

This function sets the contents of (or a portion of) this buffer object to the specified value.

Namespace: OIV.Inventor.Devices
Assembly: OIV.Inventor.Base (in OIV.Inventor.Base.dll) Version: 2024.1.0.0 (2024.1.0)
Syntax
public virtual void Memset(
	IntPtr value,
	ulong valueSize,
	ulong offset,
	ulong count
)

Parameters

value
Type: SystemIntPtr

is a pointer to the value to set in the buffer.

valueSize
Type: SystemUInt64

The size in bytes of the value. Default is 1 byte.

offset
Type: SystemUInt64

The offset in bytes (where to start setting values). Default is 0.

count
Type: SystemUInt64

The number of values to set. Default is number of bytes in buffer.

Remarks

The valueSize parameter provides a way to do a memset with float, short, byte, etc values. The number of bytes set in this buffer object is exactly valueSize*count. The first byte changed in this buffer is given by the offset argument.

EXAMPLE

IntPtr ptr = Marshal.AllocHGlobal(sizeof(int));
Marshal.WriteInt32( ptr, 0 );
buffer.Memset( ptr );
Marshal.FreeHGlobal( ptr );

See Also