Пример #1
0
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))
}
Пример #2
0
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
}
Пример #3
0
func (self *Surface) WriteToPNG(filename string) {
	p := C.CString(filename)
	C.cairo_surface_write_to_png(self.surface, p)
	C.free(unsafe.Pointer(p))
}
Пример #4
0
// Write an image to PNG
func (i *Image) WritePNG(file string) {
	C.cairo_surface_write_to_png(i.Surf, C.CString(file))
}