Loads an object from a file 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: 87.0.0.0
public static Object LoadObjectFromFile(
string path,
Type formatterType,
CogSerializationOptionsConstants optionBits
)
public static Object LoadObjectFromFile(
string path,
Type formatterType,
CogSerializationOptionsConstants optionBits
)
Public Shared Function LoadObjectFromFile (
path As String,
formatterType As Type,
optionBits As CogSerializationOptionsConstants
) As Object
Public Shared Function LoadObjectFromFile (
path As String,
formatterType As Type,
optionBits As CogSerializationOptionsConstants
) As Object
public:
static Object^ LoadObjectFromFile(
String^ path,
Type^ formatterType,
CogSerializationOptionsConstants optionBits
)
public:
static Object^ LoadObjectFromFile(
String^ path,
Type^ formatterType,
CogSerializationOptionsConstants optionBits
)
Parameters
- path
- Type: System String
The path to the input file.
- 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:
ObjectThe loaded object.
To learn more about persisting objects, see
Persistence in VisionPro