This is a simple example of how to use the libpng callbacks to save PNG data in places other than files... Note that this code is a skeleton, and wont compile out of the box.