Interface IVideoView
- Namespace
- VisioForge.Core.Types
- Assembly
- VisioForge.Core.dll
Defines a platform-agnostic interface for a video rendering view. This interface abstracts the underlying UI control used for displaying video, allowing the core engine to remain independent of any specific UI framework (e.g., WinForms, WPF, Android, iOS).
public interface IVideoViewRemarks
Implementations of this interface are responsible for managing a native UI element that can render video frames. It provides methods for lifecycle management, UI interaction, and event handling, including mouse input. The interface includes platform-specific sections to handle the unique requirements of different operating systems.
Methods
Attach(IMPVCVECore)
Attaches this view to a parent core engine component.
void Attach(IMPVCVECore parent)Parameters
parentIMPVCVECore-
The core engine component (e.g., MediaPlayerCore, VideoCaptureCore) to attach to.
CallInvoke(Delegate, params object[])
Executes a delegate on the UI thread of the control.
void CallInvoke(Delegate method, params object[] args)Parameters
CallRefresh()
Forces the view to redraw or refresh its content.
void CallRefresh()ClearUI()
Clears the user interface, removing any overlays or graphics.
void ClearUI()Detach(IMPVCVECore)
Detaches this view from a parent core engine component.
void Detach(IMPVCVECore parent)Parameters
parentIMPVCVECore-
The core engine component to detach from.
GetBackgroundColor()
Gets the background color of the video view.
SKColor GetBackgroundColor()Returns
- SKColor
-
The background color as an SkiaSharp.SKColor.
GetHandle()
Gets the native window handle of the underlying UI control.
nint GetHandle()Returns
GetInvokeRequired()
Gets a value indicating whether the caller must use an invoke method when making calls to the control.
bool GetInvokeRequired()Returns
- bool
-
trueif the call must be invoked; otherwise,false.
GetIsHandleCreated()
Gets a value indicating whether the underlying UI control's handle has been created.
bool GetIsHandleCreated()Returns
- bool
-
trueif the handle is created; otherwise,false.
GetSize()
Gets the current size of the video view.
Size GetSize()Returns
- Size
-
The size as a VisioForge.Core.Types.Size structure.
GetUIEngine()
Gets the underlying UI engine being used by the view.
VideoViewUIEngine GetUIEngine()Returns
- VideoViewUIEngine
-
The VisioForge.Core.Types.VideoViewUIEngine used for rendering.
InvokeStart()
Signals the view that the engine has started.
void InvokeStart()InvokeStartComplete()
Signals the view that the engine has completed its start sequence.
void InvokeStartComplete()InvokeStop()
Signals the view that the engine has stopped.
void InvokeStop()InvokeVideoRendererUpdate()
Triggers an update of the video renderer.
void InvokeVideoRendererUpdate()LogDialogClear()
Clears all messages from the log dialog.
void LogDialogClear()LogDialogClose()
Closes the log dialog if it is open.
void LogDialogClose()LogDialogError(string)
Displays an error message in a dialog box.
void LogDialogError(string msg)Parameters
msgstring-
The error message to display.
Remarks
An SDK engine calls this from inside its own error handler, which the logger raises. An
implementation that logs from here - including from a catch - therefore feeds the
error back into the channel that is currently reporting it, and without something to
stop it the process dies of a stack overflow (issue #1173).
The SDK breaks that loop centrally, with a re-entrancy guard in the log observer, but
the guard is per thread and covers only the call it is inside: a write made
synchronously, on the thread this method was called on, is safe. A view that
marshals to its UI thread first - DispatcherQueue.TryEnqueue,
Dispatcher.BeginInvoke, Control.BeginInvoke, Task.Run - runs its
catch on a fresh stack where the guard is already clear, and must not log from
there. Report that failure on a channel the SDK does not observe, such as
Trace.TraceError.
PictureBoxCreate(int, int)
Creates a PictureBox control for video rendering.
void PictureBoxCreate(int width, int height)Parameters
PictureBoxDestroy()
Destroys the PictureBox control.
void PictureBoxDestroy()PictureBoxExists()
Checks if the PictureBox control currently exists.
bool PictureBoxExists()Returns
- bool
-
trueif the PictureBox exists; otherwise,false.
PictureBoxGetImage()
Gets the current image from the PictureBox.
Bitmap PictureBoxGetImage()Returns
- Bitmap
-
The current bitmap image.
PictureBoxSetImage(Bitmap)
Sets the image to be displayed in the PictureBox.
void PictureBoxSetImage(Bitmap image)Parameters
imageBitmap-
The bitmap image to display.
PushMouseButtonDown(int, int, MouseButton)
Pushes a mouse button down event to the control.
void PushMouseButtonDown(int x, int y, MouseButton button)Parameters
xint-
The x-coordinate of the mouse.
yint-
The y-coordinate of the mouse.
buttonMouseButton-
The mouse button that was pressed.
PushMouseButtonUp(int, int, MouseButton)
Pushes a mouse button up event to the control.
void PushMouseButtonUp(int x, int y, MouseButton button)Parameters
xint-
The x-coordinate of the mouse.
yint-
The y-coordinate of the mouse.
buttonMouseButton-
The mouse button that was released.
PushMouseMove(int, int)
Pushes a mouse move event to the control for processing.
void PushMouseMove(int x, int y)Parameters
ResizeRoundTo(int)
Resizes the video view, rounding the dimensions to a specified value.
void ResizeRoundTo(int round)Parameters
roundint-
The value to round the dimensions to (e.g., 16).
SetHandle(nint)
Sets the native window handle. Used for embedding the video in a specific control.
void SetHandle(nint handle)Parameters
handlenint-
The window handle.
ShowMessage(string)
Shows a message box to the user.
MessageBoxResult ShowMessage(string message)Parameters
messagestring-
The message to display.
Returns
- MessageBoxResult
-
A VisioForge.Core.Types.MessageBoxResult indicating which button the user clicked.
Remarks
Reached from an engine's error handler as well - see the remarks on VisioForge.Core.Types.IVideoView.LogDialogError(System.String).
OnMouseButtonDown
Occurs when a mouse button is pressed down over the control.
event EventHandler<MouseButtonEventArgs> OnMouseButtonDownEvent Type
OnMouseButtonUp
Occurs when a mouse button is released over the control.
event EventHandler<MouseButtonEventArgs> OnMouseButtonUpEvent Type
OnMouseMoved
Occurs when the mouse pointer is moved over the control.
event EventHandler<MouseMoveEventArgs> OnMouseMoved