CogImageFile Open Method Cognex VisionPro 9.7
Open an image file.

Namespace: Cognex.VisionPro.ImageFile
Assembly: Cognex.VisionPro.ImageFile (in Cognex.VisionPro.ImageFile.dll) Version: 73.0.0.0
Syntax

public void Open(
	string fileName,
	CogImageFileModeConstants mode
)
Exceptions

ExceptionCondition
ArgumentException

mode is not a value.

CogFileOpenException

An error occurred while opening the specified file.

CogImageFileUnknownImageFileExtensionException

A supplied image file extension was not recognized.

Remarks

Opens an image file using the image file provider that corresponds to the file's extension. If more than one image file provider supports the extension, the one selected is undefined.

If you do not specify an file open mode, Open(String, CogImageFileModeConstants) defaults to Read .

Examples

Imports Cognex.VisionPro.ImageFile

 ' Append an image to a file
Dim ImageFile1 As New CogImageFile
ImageFile1.Open("c:\image.bmp", CogImageFileModeConstants.Read)
using Cognex.VisionPro.ImageFile;

// Append an image to a file
CogImageFile ImageFile1= new CogImageFile(); 
ImageFile1.Open("c:\\image.bmp", CogImageFileModeConstants.Read);
See Also