diff --git a/example/freetype/main.go b/example/freetype/main.go index 3467d3b..1675639 100644 --- a/example/freetype/main.go +++ b/example/freetype/main.go @@ -88,7 +88,7 @@ func main() { ruler = image.RGBAColor{0x22, 0x22, 0x22, 0xff} } rgba := image.NewRGBA(640, 480) - draw.Draw(rgba, draw.Rect(0, 0, 640, 480), bg, draw.ZP) + draw.Draw(rgba, rgba.Bounds(), bg, image.ZP) c := freetype.NewContext() c.SetDPI(*dpi) c.SetFont(font) diff --git a/example/gamma/main.go b/example/gamma/main.go index 7845b7f..be6ec3e 100644 --- a/example/gamma/main.go +++ b/example/gamma/main.go @@ -51,8 +51,8 @@ func main() { h = 200 ) rgba := image.NewRGBA(w, h) - draw.Draw(rgba, draw.Rect(0, 0, w, h/2), image.Black, draw.ZP) - draw.Draw(rgba, draw.Rect(0, h/2, w, h), image.White, draw.ZP) + draw.Draw(rgba, image.Rect(0, 0, w, h/2), image.Black, image.ZP) + draw.Draw(rgba, image.Rect(0, h/2, w, h), image.White, image.ZP) mask := image.NewAlpha(50, 50) painter := raster.NewAlphaPainter(mask) painter.Op = draw.Src @@ -61,9 +61,9 @@ func main() { clear(mask) r.Rasterize(raster.NewGammaCorrectionPainter(painter, g)) x, y := 50*i+25, 25 - draw.DrawMask(rgba, draw.Rect(x, y, x+50, y+50), image.White, draw.ZP, mask, draw.ZP, draw.Over) + draw.DrawMask(rgba, image.Rect(x, y, x+50, y+50), image.White, image.ZP, mask, image.ZP, draw.Over) y += 100 - draw.DrawMask(rgba, draw.Rect(x, y, x+50, y+50), image.Black, draw.ZP, mask, draw.ZP, draw.Over) + draw.DrawMask(rgba, image.Rect(x, y, x+50, y+50), image.Black, image.ZP, mask, image.ZP, draw.Over) } // Save that RGBA image to disk. diff --git a/example/raster/main.go b/example/raster/main.go index b63a51b..fb0d0b0 100644 --- a/example/raster/main.go +++ b/example/raster/main.go @@ -148,8 +148,8 @@ func main() { // Draw the mask image (in gray) onto an RGBA image. rgba := image.NewRGBA(w, h) gray := image.ColorImage{image.AlphaColor{0x1f}} - draw.Draw(rgba, draw.Rect(0, 0, w, h), image.Black, draw.ZP) - draw.DrawMask(rgba, draw.Rect(0, 0, w, h), gray, draw.ZP, mask, draw.ZP, draw.Over) + draw.Draw(rgba, rgba.Bounds(), image.Black, image.ZP) + draw.DrawMask(rgba, rgba.Bounds(), gray, image.ZP, mask, image.ZP, draw.Over) showNodes(rgba, outside) showNodes(rgba, inside)