Interface IDisplay
Display interface
Namespace: ic4
Assembly: ic4dotnet.dll
Syntax
public interface IDisplay
Remarks
To create a display, create an instance of a class implementing IDisplay, e.g. EmbeddedDisplay, FloatingDisplay or WinForms.Display.
Display objects are generally used in two distinct ways:
- The display is connected to a data stream when calling StreamSetup(Sink, IDisplay, StreamSetupOption) or StreamSetup(IDisplay, StreamSetupOption), automatically displaying all images from the opened device.
- ImageBuffer objects are displayed manually by calling DisplayBuffer(ImageBuffer).
Some functions, such as StreamSetup(IDisplay, StreamSetupOption), takes shared ownership of the display object. The display is kept alive by the grabber object even if the display object was disposed.
A zoom effect can be created by setting RenderPosition to Custom, and RenderWidth and RenderHeight to a multiple of the width and height of the image buffer(s) to be displayed. Set RenderLeft and RenderTop to negative values to specifiy the top left corner of the visible image.
Properties
RenderHeight
The height of the target rectangle inside the display
Declaration
int RenderHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| int | The height of the target rectangle inside the display |
Exceptions
| Type | Condition |
|---|---|
| IC4Exception | Check ErrorCode and ToString() for details. |
RenderLeft
The left coordinate of the target rectangle inside the display
Declaration
int RenderLeft { get; set; }
Property Value
| Type | Description |
|---|---|
| int | The left coordinate of the target rectangle inside the display |
Exceptions
| Type | Condition |
|---|---|
| IC4Exception | Check ErrorCode and ToString() for details. |
RenderPosition
The scaling and alignment mode to use
Declaration
DisplayRenderPosition RenderPosition { get; set; }
Property Value
| Type | Description |
|---|---|
| DisplayRenderPosition | The scaling and alignment mode to use |
Exceptions
| Type | Condition |
|---|---|
| IC4Exception | Check ErrorCode and ToString() for details. |
RenderTop
The top coordinate of the target rectangle inside the display
Declaration
int RenderTop { get; set; }
Property Value
| Type | Description |
|---|---|
| int | The top coordinate of the target rectangle inside the display |
Exceptions
| Type | Condition |
|---|---|
| IC4Exception | Check ErrorCode and ToString() for details. |
RenderWidth
The width of the target rectangle inside the display
Declaration
int RenderWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| int | The width of the target rectangle inside the display |
Exceptions
| Type | Condition |
|---|---|
| IC4Exception | Check ErrorCode and ToString() for details. |
Statistics
Queries display statistics.
Declaration
DisplayStatistics Statistics { get; }
Property Value
| Type | Description |
|---|---|
| DisplayStatistics | A structure contains display statistics |
Exceptions
| Type | Condition |
|---|---|
| IC4Exception | Check ErrorCode and ToString() for details. |
Methods
CanRender(ImageType)
Checks whether the display can render images of a specified image type.
Declaration
bool CanRender(ImageType imageType)
Parameters
| Type | Name | Description |
|---|---|---|
| ImageType | imageType | The image type to check |
Returns
| Type | Description |
|---|---|
| bool |
|
Exceptions
| Type | Condition |
|---|---|
| IC4Exception | Check ErrorCode and ToString() for details. |
DisplayBuffer(ImageBuffer)
Displays a specific image buffer.
Declaration
void DisplayBuffer(ImageBuffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| ImageBuffer | buffer | The buffer to display |
Remarks
When buffer is null, the display is cleared and will no longer display the previous buffer.
Exceptions
| Type | Condition |
|---|---|
| IC4Exception | Check ErrorCode and ToString() for details. |
ThrowIfCannotRender(ImageType)
Checks whether the display can render images of a specified image type.
If the image type can not be rendered, an exception is thrown.
Declaration
void ThrowIfCannotRender(ImageType imageType)
Parameters
| Type | Name | Description |
|---|---|---|
| ImageType | imageType | The image type to check |
Exceptions
| Type | Condition |
|---|---|
| IC4Exception | Check ErrorCode and ToString() for details. |