Constructor Direct2DControl
- Namespace
- PaintDotNet.Controls
- Assembly
- PaintDotNet.Framework.dll
Direct2DControl()
Initializes a new instance of the Direct2DControl class. A new Direct2D factory is created, providing an isolated resource domain for this control instance.
protected Direct2DControl()
Direct2DControl(IDirect2DFactory)
Initializes a new instance of the Direct2DControl, using the given Direct2D factory.
protected Direct2DControl(IDirect2DFactory d2dFactory)
Parameters
d2dFactory
IDirect2DFactoryThe factory to use.
Remarks
If you are implementing a GpuEffect with a custom EffectConfigForm that uses Direct2DControl(s),
it is not a good idea to share the IDirect2DFactory between the GpuEffect and the control.
This will cause performance issues because the factory is also a lock, and all calls into the factory or
any objects created from it will enter that lock. So if the GpuEffect is rendering, it will stall the UI
thread and make it not as responsive.
However, if you have multiple Direct2DControls then it is a good idea to share one factory
between them all (just not the one that the GpuEffect is using!). This will save memory, and also permits
sharing Direct2D objects amongst the controls.