ApngEncoder
Streaming encoder for Animated PNG (APNG) files. Frames are compressed and written to the output stream the moment they are added, so a complete animation never needs to reside in memory at once.
Constructors
ApngEncoder
#Create an encoder that writes to an existing stream. The stream must be seekable so the frame count can be back-patched once all frames are known. The caller retains ownership of the stream.
Properties
Methods
AddFrame
#Append a frame to the animation. The bitmap is compressed and written immediately, so the caller may dispose it as soon as this method returns. Every frame must share the dimensions of the first frame.
Parameters:
| frame (Bitmap) | Frame image. Must be a 32-bits-per-pixel bitmap. |
| delayMs (int) | Duration this frame stays on screen, in milliseconds (0..65535). |
Dispose
#public void Dispose()
Finish the animation (when it holds at least one frame) and release the underlying stream if this encoder owns it.
Encode
#Convenience helper that encodes a complete array of frames with a single uniform delay. Buffers no more than one frame at a time internally.