Loads an object from a stream in a specified format, with option bits that cause fields to be selectively persisted.
Namespace: Cognex.VisionProAssembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 80.0.0.0
public static Object LoadObjectFromStream(
Stream stream,
Type formatterType,
CogSerializationOptionsConstants optionBits,
StreamingContextStates contextStates
)
public static Object LoadObjectFromStream(
Stream stream,
Type formatterType,
CogSerializationOptionsConstants optionBits,
StreamingContextStates contextStates
)
Public Shared Function LoadObjectFromStream (
stream As Stream,
formatterType As Type,
optionBits As CogSerializationOptionsConstants,
contextStates As StreamingContextStates
) As Object
Public Shared Function LoadObjectFromStream (
stream As Stream,
formatterType As Type,
optionBits As CogSerializationOptionsConstants,
contextStates As StreamingContextStates
) As Object
public:
static Object^ LoadObjectFromStream(
Stream^ stream,
Type^ formatterType,
CogSerializationOptionsConstants optionBits,
StreamingContextStates contextStates
)
public:
static Object^ LoadObjectFromStream(
Stream^ stream,
Type^ formatterType,
CogSerializationOptionsConstants optionBits,
StreamingContextStates contextStates
)
Parameters
- stream
- Type: System.IO Stream
The input stream.
- formatterType
- Type: System Type
The type of formatter to use. You may use either a BinaryFormatter (to save the object as binary data) or a SoapFormatter (to save the object as XML text). For example, to use the SoapFormatter in C# you would type: typeof(System.Runtime.Serialization.Formatters.Soap.SoapFormatter)
- optionBits
- Type: Cognex.VisionPro CogSerializationOptionsConstants
The option bits specifying what should be persisted.
- contextStates
- Type: System.Runtime.Serialization StreamingContextStates
Context states indicate the intended purpose of persisting. These flags are ignored on load by VisionPro .NET objects.
Return Value
Type:
ObjectThe loaded object.
To learn more about persisting objects, see
Persistence in VisionPro