aboutsummaryrefslogtreecommitdiff
path: root/doc/progs/image_package4.go
blob: c46fddf07a1b869239000f31635bcc0a23b68adb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import (
	"fmt"
	"image"
)

func main() {
	r := image.Rect(0, 0, 4, 3).Intersect(image.Rect(2, 2, 5, 5))
	// Size returns a rectangle's width and height, as a Point.
	fmt.Printf("%#v\n", r.Size()) // prints image.Point{X:2, Y:1}
}