FrameDurationRounding Enum

Controls how an encoder converts exact FrameDuration values to the timing representation of its format.

public enum FrameDurationRounding

Remarks

Durations outside the range representable by the format always throw; they are never clamped.

Fields

NameValueDescription
RequireExact0Throws an UnsupportedImageFeatureException if a duration cannot be represented exactly.
RoundToNearest1Rounds each duration to the nearest representable value (ties round up): the nearest hundredth for GIF, the nearest millisecond for WebP and JPEG XL, the nearest sixtieth of a second for ANI, the nearest fraction with 16-bit numerator and denominator for APNG, the nearest microsecond for an AVIF or HEIC image sequence whose durations have no common time scale of 32 bits (it stores them exactly otherwise).