Table of Contents

Class DynamicImage

Namespace
PaintDotNet.Direct2D1
Assembly
PaintDotNet.Windows.Framework.dll

A dynamic image is a IDeviceImage that is similar to an effect (IDeviceEffect), but typically uses rendering techniques that are either not possible or performance-prohibitive within the context of an effect implementation.

public abstract class DynamicImage : RefTrackedObject, ISerializable, IDynamicImage, IDeviceImage, IDirect2DResource, IFactoryProperty, IInternalImpl, IObjectRef, IIsDisposed, IDisposable
Inheritance
DynamicImage
Implements
Derived
Inherited Members
Extension Methods

Remarks

NOTE: Due to limitations in the Direct2D effects and rendering systems, inputs to dynamic images that are also used in effect graphs may need to be wrapped in an ICommandList when used outside of the dynamic image. You can use the CreateBufferedImage(IDeviceContext, IDeviceImage) extension method for this. See that method for more details.

NOTE: Dynamic images usually require the device context's target to be using a buffer precision of Float32 for correct rendering.
If your target is lower precision, use CreateCompatibleDeviceContext(SizeFloat?, SizeInt32?, DevicePixelFormat?, CompatibleDeviceContextOptions) to create an off-screen buffer to render the dynamic image into, and then draw the compatible device context's bitmap to the final render target (device context).

Properties

DeviceContext
Factory

Retrieves the factory associated with this resource.

InputCount
MaxInputCount
MinInputCount
Properties

Methods

CreateProperties()
Dispose(bool)
DisposeImpl(bool)
GetCachedInputLocalBounds(int)
GetInput(int)
GetInputInfo(int)
GetOutput()

Gets the underlying image or effect graph.

GetPropertyInfo(string)
GetPropertyInfos()
GetValue(string, Span<byte>)
GetValueObject(string)
GetValueSize(string)
InvalidateOutput()
OnCreateOutput()
OnPrecisionChanged(BufferPrecision, BufferPrecision)
SetInput(int, IDeviceImage?)
SetValue(string, ReadOnlySpan<byte>)
SetValueObject(string, object?)
UpdateOutput()

Ensures that the underlying image or effect graph has been updated for the latest property changes, as well as for any layout changes to the inputs.