diff --git a/example/freetype/main.go b/example/freetype/main.go index 7a11caf2e39be9a2d658050212cc46410dfddb44..3714b615d49832fd6d7d707315db0457cdfe9a9c 100644 --- a/example/freetype/main.go +++ b/example/freetype/main.go @@ -7,11 +7,11 @@ package main import ( "bufio" - "exp/draw" "flag" "fmt" "freetype-go.googlecode.com/hg/freetype" "image" + "image/draw" "image/png" "io/ioutil" "log" @@ -86,7 +86,7 @@ func main() { ruler = image.RGBAColor{0x22, 0x22, 0x22, 0xff} } rgba := image.NewRGBA(640, 480) - draw.Draw(rgba, rgba.Bounds(), bg, image.ZP) + draw.Draw(rgba, rgba.Bounds(), bg, image.ZP, draw.Src) c := freetype.NewContext() c.SetDPI(*dpi) c.SetFont(font) diff --git a/example/gamma/main.go b/example/gamma/main.go index cc254750dd95132d9b1e9ee5e094cc5b050e6960..8fe453961ca5152100dd58bc083712a15b4cabe4 100644 --- a/example/gamma/main.go +++ b/example/gamma/main.go @@ -7,9 +7,9 @@ package main import ( "bufio" - "exp/draw" "fmt" "image" + "image/draw" "image/png" "log" "os" @@ -51,8 +51,8 @@ func main() { h = 200 ) rgba := image.NewRGBA(w, h) - 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) + draw.Draw(rgba, image.Rect(0, 0, w, h/2), image.Black, image.ZP, draw.Src) + draw.Draw(rgba, image.Rect(0, h/2, w, h), image.White, image.ZP, draw.Src) mask := image.NewAlpha(50, 50) painter := raster.NewAlphaSrcPainter(mask) gammas := []float64{1.0 / 10.0, 1.0 / 3.0, 1.0 / 2.0, 2.0 / 3.0, 4.0 / 5.0, 1.0, 5.0 / 4.0, 3.0 / 2.0, 2.0, 3.0, 10.0} diff --git a/example/raster/main.go b/example/raster/main.go index 38615926f01e79ecf54d4cece199f7aac04a5904..af04d6336a5047132fb2f41c28be8e8c59e29ee6 100644 --- a/example/raster/main.go +++ b/example/raster/main.go @@ -7,9 +7,9 @@ package main import ( "bufio" - "exp/draw" "fmt" "image" + "image/draw" "image/png" "log" "os" @@ -113,7 +113,7 @@ func showNodes(m *image.RGBA, ns []node) { for _, n := range ns { p := p(n) x, y := int(p.X)/256, int(p.Y)/256 - if !m.Bounds().Contains(image.Point{x, y}) { + if !(image.Point{x, y}).In(m.Bounds()) { continue } var c image.Color @@ -147,7 +147,7 @@ func main() { // Draw the mask image (in gray) onto an RGBA image. rgba := image.NewRGBA(w, h) gray := image.NewColorImage(image.AlphaColor{0x1f}) - draw.Draw(rgba, rgba.Bounds(), image.Black, image.ZP) + draw.Draw(rgba, rgba.Bounds(), image.Black, image.ZP, draw.Src) draw.DrawMask(rgba, rgba.Bounds(), gray, image.ZP, mask, image.ZP, draw.Over) showNodes(rgba, outside) showNodes(rgba, inside)