コード例 #1
0
ファイル: canvas.go プロジェクト: mishudark/gosexy
// 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
ファイル: magick_image.go プロジェクト: rli-diraryi/paint
/* 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
}