// Copies a drawing surface to the canvas. func (self *Canvas) Update() error { success := C.MagickDrawImage(self.wand, self.drawing) if success == C.MagickFalse { return fmt.Errorf("Could not update image: %s", self.Error()) } return nil }
func (self *Canvas) DrawAnnotation(content string, width, height uint) error { ccontent := C.CString("caption:" + content) defer C.free(unsafe.Pointer(ccontent)) C.DrawAnnotation(self.drawing, 20, 20, (*C.uchar)(unsafe.Pointer(ccontent))) if C.MagickDrawImage(self.wand, self.drawing) == C.MagickFalse { return fmt.Errorf(`Could not draw annotation: %s`, self.Error()) } return nil }
func (self *Canvas) SetCaption(content string) error { ccontent := C.CString("caption:" + content) defer C.free(unsafe.Pointer(ccontent)) if C.MagickReadImage(self.wand, ccontent) == C.MagickFalse { return fmt.Errorf(`Could not open image "%s": %s`, content, self.Error()) } C.MagickDrawImage(self.wand, self.drawing) return nil }
// Copies a drawing surface to the canvas. func (cv Canvas) Update() { C.MagickDrawImage(cv.wand, cv.drawing) }