Exemple #1
0
func Scale(p *Pixbuf, x, y, width, height int, offsetX, offsetY, scaleX, scaleY float64, interp InterpType) *Pixbuf {
	var gpixbuf *C.GdkPixbuf
	C.gdk_pixbuf_scale(
		p.GPixbuf,
		gpixbuf,
		C.int(x), C.int(y),
		C.int(width), C.int(height),
		C.double(offsetX), C.double(offsetY),
		C.double(scaleX), C.double(scaleY),
		C.GdkInterpType(interp))
	return &Pixbuf{
		GdkPixbuf: &GdkPixbuf{gpixbuf},
		GObject:   glib.ObjectFromNative(unsafe.Pointer(gpixbuf)),
	}
}
Exemple #2
0
/*
Creates a transformation of the source image @src by scaling by
@scale_x and @scale_y then translating by @offset_x and @offset_y,
then renders the rectangle (@dest_x, @dest_y, @dest_width,
@dest_height) of the resulting image onto the destination image
replacing the previous contents.

Try to use gdk_pixbuf_scale_simple() first, this function is
the industrial-strength power tool you can fall back to if
gdk_pixbuf_scale_simple() isn't powerful enough.

If the source rectangle overlaps the destination rectangle on the
same pixbuf, it will be overwritten during the scaling which
results in rendering artifacts.
*/
func (self *TraitPixbuf) Scale(dest IsPixbuf, dest_x int, dest_y int, dest_width int, dest_height int, offset_x float64, offset_y float64, scale_x float64, scale_y float64, interp_type C.GdkInterpType) {
	C.gdk_pixbuf_scale(self.CPointer, dest.GetPixbufPointer(), C.int(dest_x), C.int(dest_y), C.int(dest_width), C.int(dest_height), C.double(offset_x), C.double(offset_y), C.double(scale_x), C.double(scale_y), interp_type)
	return
}
Exemple #3
0
// Scale is a wrapper around gdk_pixbuf_scale().
func (v *Pixbuf) Scale(dst *Pixbuf, x, y, width, height int, offsetX, offsetY, scaleX, scaleY float64, interp InterpType) {
	C.gdk_pixbuf_scale(v.Native(), dst.Native(), C.int(x), C.int(y), C.int(width), C.int(height), C.double(offsetX), C.double(offsetY), C.double(scaleX), C.double(scaleY), C.GdkInterpType(interp))
}