]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1] doc: simplify the image_draw article example for converting...
authorAndrew Gerrand <adg@golang.org>
Thu, 26 Apr 2012 18:39:33 +0000 (11:39 -0700)
committerAndrew Gerrand <adg@golang.org>
Thu, 26 Apr 2012 18:39:33 +0000 (11:39 -0700)
««« CL 6119054 / a7183646b353
doc: simplify the image_draw article example for converting an image to
RGBA.

R=adg, r, bsiegert
CC=golang-dev
https://golang.org/cl/6119054
»»»

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6119056

doc/progs/image_draw.go

index 2cc5c632f325a4c160d17e58482b7b6af8f7580c..bb73c8a714f0fc752d34a12445b91023bf27f0f7 100644 (file)
@@ -84,8 +84,8 @@ func ConvAndCircle() {
 
        // CONV OMIT
        b := src.Bounds()
-       m := image.NewRGBA(image.Rect(0, 0, b.Dx(), b.Dy()))
-       draw.Draw(m, m.Bounds(), src, b.Min, draw.Src)
+       m := image.NewRGBA(b)
+       draw.Draw(m, b, src, b.Min, draw.Src)
        // STOP OMIT
 
        p := image.Point{100, 100}