CogSerializer LoadObjectFromStream Method (Stream, Type, CogSerializationOptionsConstants)Cognex VisionPro 9.24
Loads an object from a stream in a specified format, with option bits that cause fields to be selectively persisted.

Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 91.0.0.0
Syntax

public static Object LoadObjectFromStream(
	Stream stream,
	Type formatterType,
	CogSerializationOptionsConstants optionBits
)

Parameters

stream
Type: System.IO Stream
The input stream.
formatterType
Type: System Type
The type of formatter to use. Use a BinaryFormatter to save the object as binary data. For example, to use the BinaryFormatter in C# you would type: typeof(System.Runtime.Serialization.Formatters.Binary.BinaryFormatter)
optionBits
Type: Cognex.VisionPro CogSerializationOptionsConstants
The option bits specifying what should be persisted.

Return Value

Type: Object
The loaded object.
Remarks

To learn more about persisting objects, see Persistence in VisionPro
See Also