# File lib/gd2/image.rb, line 411 def with_clipping(x1, y1, x2, y2) #:yields: image clip = clipping set_clip = SYM[:gdImageSetClip] begin set_clip.call(image_ptr, x1, y1, x2, y2) yield self self ensure set_clip.call(image_ptr, *clip) end end