CogDisplay CreateContentBitmap Method Cognex VisionPro 9.5
Returns the current content of the display (image and graphics) as a bitmap in a picture object.

Namespace: Cognex.VisionPro.Display
Assembly: Cognex.VisionPro.Display.Controls (in Cognex.VisionPro.Display.Controls.dll) Version: 69.0.0.0 (69.0.0.0)
Syntax

public virtual Image CreateContentBitmap(
	CogDisplayContentBitmapConstants content,
	[OptionalAttribute] CogRectangle contentRect,
	[OptionalAttribute] int bitmapSize
)

Parameters

content
Type: Cognex.VisionPro.Display CogDisplayContentBitmapConstants
The type of content bitmap to create.
contentRect (Optional)
Type: Cognex.VisionPro CogRectangle
The rectangle within the display to return as a bitmap.
bitmapSize (Optional)
Type: System Int32
The maximum dimension for the requested bitmap.

Return Value

Type: Image
The returned bitmap.
Exceptions

ExceptionCondition
AxHost InvalidActiveXStateException Thrown when the display control is invalid.
CogException Thrown when one of the followings happen: BitmapSize is less than 0, if return bitmap cannot be allocated, or CogSpaceTree errors if passed content rect cannot be mapped to pixel(#) space.
Remarks

The content parameter specifies how the bitmap is created.

If you use Custom as the content parameter the contentRect and bitmapSize parameters specify which portion of the displayed image is used to create the bitmap. If bitmapSize is zero, the returned bitmap is the unscaled portion of the image that contentRect describes. If bitmapSize is not zero, it is used as the largest dimension of the resulting bitmap, and the bitmap has the same aspect ratio as contentRect.

If contentRect is   and bitmapSize is zero, the returned bitmap is the unscaled contents of the display.

See Also