示例#1
0
// Writes canvas to a file, returns true on success.
func (cv Canvas) Write(filename string) bool {
	cv.Update()
	status := C.MagickWriteImage(cv.wand, C.CString(filename))
	if status == C.MagickFalse {
		return false
	}
	return true
}
示例#2
0
/* Writes an image to the specified filename. */
func (w *MagickWand) WriteImage(fileName string) error {
	if C.MagickWriteImage(w.wand, C.CString(fileName)) == C.MagickFalse {
		eStr, eCode := w.Exception()
		return fmt.Errorf("WriteImage() failed : [%d] %s", eStr, eCode)
	}

	return nil
}
示例#3
0
文件: canvas.go 项目: jmrobles/canvas
// Writes canvas to a file, returns true on success.
func (self Canvas) Write(filename string) error {
	err := self.Update()

	if err != nil {
		return err
	}

	success := C.MagickWriteImage(self.wand, C.CString(filename))

	if success == C.MagickFalse {
		return fmt.Errorf("Could not write: %s", self.Error())
	}

	return nil
}
示例#4
0
文件: canvas.go 项目: phacops/canvas
// Writes canvas to a file, returns true on success.
func (self *Canvas) Write(filename string) error {
	err := self.Update()

	if err != nil {
		return err
	}

	cfilename := C.CString(filename)
	success := C.MagickWriteImage(self.wand, cfilename)
	C.free(unsafe.Pointer(cfilename))

	if success == C.MagickFalse {
		return fmt.Errorf("Could not write: %s", self.Error())
	}

	return nil
}