Click or drag to resize

IDecoderManagerSetDisplayLayout Method

Sets display layout for provided decoder.

Namespace: Bosch.Vms.SDK
Assembly: Bosch.Vms.SDK (in Bosch.Vms.SDK.dll) Version: 1.9.0.0
Syntax
C#
bool SetDisplayLayout(
	Decoder decoder,
	DisplayLayout displayLayout
)

Parameters

decoder  Decoder
Decoder handle where layout should be changed.
displayLayout  DisplayLayout
Decoder layout that should be set. Could be retrieved from GetSupportedDisplayLayouts(Decoder)or GetSelectedDisplayLayout(Decoder).

Return Value

Boolean
True if layout was changed.
Exceptions
ExceptionCondition
SdkException Thrown if decoder doesn't exist in the configuration or is not permitted to caller. Thrown if displayLayout is not supported.
Remarks
Tip  Tip
Do not use constructor of DisplayLayout class to create layout to set. Use GetSupportedDisplayLayouts(Decoder) to get list of supported DisplayLayout's instead.
Tip  Tip
Feature is only available for decoder monitor panes which are assigned to any Monitor Group. To find out which layouts can be applied to a certain decoder, an SDK application or script can use GetSupportedDisplayLayouts(Decoder) and pick one of the DisplayLayout objects from the collection returned by that method.
Example
To enable SingleView mode, a list of supported layouts should be retrieved and filtered to get corresponding DisplayLayout. When retrieved, it could be set by SetDisplayLayout(Decoder, DisplayLayout):
C#
try
{
    //Getting decoder monitor pane with first number of pane from first monitor and from decoder with IP 1.1.1.1.
    Decoder decoder = decoderManager.GetDecoderByName("Monitor 1 (1.1.1.1) (1));
    IList<DisplayLayout> supportedLayouts = decoderManager.GetSupportedDisplayLayouts(decoder);
    DisplayLayout singleViewLayout = supportedLayouts.FirstOrDefault(x => x.CameoCount == 1);
    if (singleViewLayout != null)
    {
        decoderManager.SetDisplayLayout(decoder, singleViewLayout);
    }
}
catch (SdkException)
{
    // do something
}
See Also