Example #1
0
// Removes a region of a canvas and collapses the canvas to occupy the removed portion.
func (cv Canvas) Chop(x int, y int, width uint, height uint) bool {
	status := C.MagickChopImage(cv.wand, C.size_t(width), C.size_t(height), C.ssize_t(x), C.ssize_t(y))
	if status == C.MagickFalse {
		return false
	}
	return true
}
Example #2
0
// Removes a region of a canvas and collapses the canvas to occupy the removed portion.
func (self *Canvas) Chop(x int, y int, width uint, height uint) error {
	success := C.MagickChopImage(self.wand, C.size_t(width), C.size_t(height), C.ssize_t(x), C.ssize_t(y))

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

	return nil
}