ICogImage8GreyData Get8GreyPixelMemory Method Cognex VisionPro 9.10
Gets an object that can be used to directly access pixel memory. The caller MUST call Dispose on this object when finished with it.

Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 79.0.0.0
Syntax

ICogImage8PixelMemory Get8GreyPixelMemory(
	CogImageDataModeConstants dataMode,
	int x,
	int y,
	int width,
	int height
)

Parameters

dataMode
Type: Cognex.VisionPro CogImageDataModeConstants

Specifies whether the pixel data are read, write, or read/write.

x
Type: System Int32

The x-coordinate of the portion of the image to get.

y
Type: System Int32

The y-coordinate of the portion of the image to get.

width
Type: System Int32

The width of the image to get.

height
Type: System Int32

The height of the image to get.

Return Value

Type: ICogImage8PixelMemory

An object that represents the pixel data.

Exceptions

ExceptionCondition
CogImageBadCoordException

x, y, height, and width describe a region that is not entirely within the image.

Remarks

Gets an CogImage8PixelMemory object that can be used to access pixel memory directly. You must call this object's Dispose  method when you are finished with it.

The x, y, height, and width parameters let you specify the portion of the image to get. To access the pixel memory for the entire image, specify zero for these parameters.

If you request read/write or write-only access to the pixel memory when you call Get8GreyPixelMemory(CogImageDataModeConstants, Int32, Int32, Int32, Int32), the pixel memory may be copied internally. Any changes that you make to the pixel may not be written back to the image until you call Dispose . Your application should assume that no changes to the image take place until then.

See Also