Class Direct2DPanel
- Namespace
- VisioForge.Core.D2DRenderer
- Assembly
- VisioForge.Core.dll
Class Direct2DPanel. Implements the Panel
public class Direct2DPanel : Panel, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposableInheritance
Implements
Inherited Members
Constructors
Direct2DPanel()
Initializes a new instance of the VisioForge.Core.D2DRenderer.Direct2DPanel class.
public Direct2DPanel()Properties
Context
Gets or sets the logging/execution context used for structured error reporting. Set by the engine via ContextPropagator after the panel is created.
[Browsable(false)]
public BaseContext Context { get; set; }Property Value
MaintainAspectRatio
Gets or sets a value indicating whether to maintain aspect ratio.
[Browsable(true)]
public bool MaintainAspectRatio { get; set; }Property Value
Methods
Clear() Deprecated
Use ReleaseResources(); the name 'Clear' is misleading because it disposes all Direct2D resources rather than only clearing rendered content. A future Clear() that only clears content may be reintroduced.
Legacy alias for VisioForge.Core.D2DRenderer.Direct2DPanel.ReleaseResources. Misleadingly named — it does not just clear the rendered content but disposes every Direct2D resource and the unmanaged staging buffer, leaving the panel non-renderable.
[Obsolete("Use ReleaseResources(); the name 'Clear' is misleading because it disposes all Direct2D resources rather than only clearing rendered content. A future Clear() that only clears content may be reintroduced.")]
public void Clear()Dispose(bool)
Releases the unmanaged resources used by the Control and its child controls and optionally releases the managed resources.
protected override void Dispose(bool disposing)Parameters
disposingbool-
true to release both managed and unmanaged resources; false to release only unmanaged resources.
OnHandleCreated(EventArgs)
Raises the HandleCreated event and initializes Direct2D resources now that a valid HWND exists.
protected override void OnHandleCreated(EventArgs e)Parameters
OnResize(EventArgs)
Raises the Resize event.
protected override void OnResize(EventArgs e)Parameters
PushFrame(VideoFrameX)
Pushes the frame.
public void PushFrame(VideoFrameX frame)Parameters
frameVideoFrameX-
The frame.
PushFrame(nint, uint, uint, uint)
Pushes the frame.
public void PushFrame(nint rgbaDataPtr, uint width, uint height, uint stride)Parameters
rgbaDataPtrnint-
The rgba data PTR.
widthuint-
The width.
heightuint-
The height.
strideuint-
The stride.
ReleaseResources()
Releases all Direct2D resources held by this panel (factory, render target, bitmap) and frees the unmanaged RGBA staging buffer used by PushFrame. After this call the panel is in the same state as a freshly-disposed instance and cannot render again.
public void ReleaseResources()Remarks
This is the rendering-stop / shutdown path. To clear the rendered content while keeping the panel alive, use a future Clear-content API instead (the legacy VisioForge.Core.D2DRenderer.Direct2DPanel.Clear method, kept for binary compatibility, redirects here).
SetMinimizedState(bool)
Sets the state of the minimized.
public void SetMinimizedState(bool minimized)Parameters
minimizedbool-
if set to
true[minimized].