Tutorial 4 – Display Layouts vport

Tutorial 3 – Simple Video

In the last tutorial, we learned how to display video in a simple 1×1 layout. We allowed AxAuga to use its default specifiers for just about everything.

In this tutorial, we’re going to do some interesting things with video layouts and show some of the features AxAuga gives us.

First, let’s change the default size of our Windows Form and the AxAuga instance Control so that we have some room to work:

Because AxAuga is a Windows Control, it includes the both Size and Location properties. Setting these properties allows you place the AxAuga Control wherever you’d like. For the purposes of this tutorial, we’ll have it take up the entire client area starting in the upper-left corner.

We should now have a Windows Form taken up entirely by a 1×1 video frame.

For a reminder, here’s what we have so far from the previous tutorial:

Now let’s create a side by side or 2×1 video window:

LoadLayoutFromString, as you can imagine, takes a string which represents a layout configuration for AxAuga.
The format of the layout string is: “LayoutProperty:LayoutParameters”. Here’s the definition of the LayoutProperty we used in the above code:

LayoutProperty: vport
Description: Sets up a viewport in the specified area for AxAuga.
LayoutParameters: ViewPortID,x,y,x2,y2
ViewPortID: 0 indexed viewport identifier.
x: X coordinate of top left corner, starting at 0.0
y: Y coordinate of top left corner, starting at 0.0
x2: X coordinate of bottom right corner, ends at 1.0
y2: Y coordinate of bottom right corner, ends at 1.0
Optional: keepaspect: viewport id, aspect value
viewport id: 0 indexed viewport identifier.
aspect value: To keep the camera aspect ratio, set to 1.

If an application is running in GDI mode, the same result can be obtained by calling,

There are no layouts in GDI mode.

Using the “vport” LayoutProperty we can specify any type of viewport configuration we want: 1×1, 2×1, 2×2, etc.

Screenshots of the final program:

That’s about it. You can now create layouts that will display multiple video streams at the same time.

Tutorial 5 – Display Layouts salvo