CogImageFile Open Method Cognex VisionPro 9.22 SR1
Open an image file.

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

public void Open(
	string fileName,
	CogImageFileModeConstants mode
)

Parameters

fileName
Type: System String

The name of the image file to open.

mode
Type: Cognex.VisionPro.ImageFile CogImageFileModeConstants

A CogImageFileModeConstants value that indicates that mode in which to open the image file.

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