WinForms Demo Application
Windows Forms (WinForms) is a graphical (GUI) class library included as part of Microsoft .NET.
STANAG Player SDK's WinForms demo application demonstrates basic player functionality for STANAG file and stream playback.
Building the Demo Application
By default, the demo application is installed in:
C:\Program Files\ImpleoTV\StanagPlayerSdkNet\Samples\KlvPlayerDemoWinForms
Open the KlvPlayerDemoWinFormsPr
solution or project and build it as a 64-bit application (Debug or Release).
The code is mostly self-explanatory. The main difference from the console version is that a Window handle is passed to the SDK — the video will be rendered in this window.
Assigning the Window Handle
m_KlvPlayer.Hwnd = (int)this.VideoPanel.Handle; // Set window handle for video rendering
m_KlvPlayer.RenderVideo = true;
Overlay Demo
The WinForms demo application includes an overlay feature that allows you to add static and dynamic text, images, and symbols.
Prerequisites
To ensure the client works properly, the host PC must have a graphics card that supports DirectX.
You can verify DirectX support by running dxdiag.exe
, navigating to the Display tab, and checking whether DirectX features are enabled.
Additionally, you must install the Direct3D 9 runtime DLLs, available here:
https://www.microsoft.com/en-us/download/details.aspx?id=8109
Note: The STANAG Player SDK setup does not include the DirectX runtime. If the target machine does not have it installed, the overlay functionality will not work.
Working with the DirectX Renderer
Before starting playback, make sure to check the Enable Overlay option.
Also ensure that the Direct3D 9 (D3d9) runtime is installed on the machine. Without it, overlay rendering will not function correctly.
Creating Overlay Control Dialogs
Clicking the New Overlay button creates a new instance of an overlay control.
Each overlay control manages its own lifecycle of overlay objects. A lifecycle consists of submitting (presenting) a group of defined elements—such as text, bitmaps, or vector symbols—or removing them.
Typically, two overlay controls are used: - One for a constant overlay background - One for frequently updated objects
Each overlay control has its own Z-index: - The first created is rendered in the background. - The last created appears in the foreground.
Overlay settings are saved in:
C:\ProgramData\ImpleoTV\KlvPlayeremoWinForms\OverlayItems
These settings are automatically loaded when the overlay control is opened again.