Writing

png_write_frame_head()

void png_write_frame_head(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers, png_uint_32 width, png_uint_32 height, png_uint_32 x_offset, png_uint_32 y_offset, png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, png_byte blend_op);

This function must be called before writing the image data of every frame in a PNG image with an acTl chunk.

The parameters are pretty self-explanatory, take a look at the APNG spec for precise descriptions and limitations.

png_write_frame_tail()

void png_write_frame_tail(png_structp png_ptr, png_infop info_ptr);

This function must be called after writing the image data of every frame.