An example of using Cairo::ImageSurface class to render to PNG
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
#endif
#include <cairommconfig.h>
#include <cairomm/context.h>
#include <cairomm/surface.h>
int main()
{
#ifdef CAIRO_HAS_PNG_FUNCTIONS
std::string filename =
"image.png";
std::cout <<
"Wrote png file \"" << filename <<
"\"" <<
std::endl;
#else
std::cout << "You must compile cairo with PNG support for this example to work."
<< std::endl;
#endif
}