CogSerializer SaveObjectToFile Method (Object, String, Type, CogSerializationOptionsConstants)Cognex VisionPro 9.23
Saves an object to a file 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 void SaveObjectToFile(
	Object obj,
	string path,
	Type formatterType,
	CogSerializationOptionsConstants optionBits
)

Parameters

obj
Type: System Object
The object to save.
path
Type: System String
The path to the 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.
Remarks

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