IVideoFramePreviewBitmap Property

Returns a preview bitmap for the last video frame as an array of byte.

Definition

Namespace: ASCOM.DeviceInterface
Assembly: ASCOM.DeviceInterfaces (in ASCOM.DeviceInterfaces.dll) Version: 7.1.3+4851.c5da65c2b
C#
byte[] PreviewBitmap { get; }

Property Value

Byte
The preview bitmap image.

Remarks

Must be implemented, must not throw an ASCOM.PropertyNotImplementedException.

The application can use this bitmap to show a preview image of the last video frame when required. This is a convenience property for those applications that don't require to process the ImageArray but usually only adjust the video camera settings and then record a video file.

When a 24bit RGB image can be returned by the driver this should be the preferred format.

Example

The following code can be used to create a Bitmap from the returned byte array
C#
using (var memStr = new MemoryStream(frame.PreviewBitmap))
{
bitmap = (Bitmap)Image.FromStream(memStr);
}

Exceptions

NotConnectedExceptionIf the device is not connected
DriverExceptionAn error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself.

See Also