func (self *Surface) WriteToPNG(filename string) Status { cs := C.CString(filename) defer C.free(unsafe.Pointer(cs)) return Status(C.cairo_surface_write_to_png(self.surface, cs)) }
func (v *Surface) WriteToPng(filename string) error { cstr := C.CString(filename) defer C.free(unsafe.Pointer(cstr)) status := C.cairo_surface_write_to_png(v.native(), cstr) if status != C.CAIRO_STATUS_SUCCESS { return errors.New("error writing to PNG file") } return nil }
func (self *Surface) WriteToPNG(filename string) { p := C.CString(filename) C.cairo_surface_write_to_png(self.surface, p) C.free(unsafe.Pointer(p)) }
// Write an image to PNG func (i *Image) WritePNG(file string) { C.cairo_surface_write_to_png(i.Surf, C.CString(file)) }