func main() { m := Image{50, 50, color.RGBA{0, 0, 0, 255}, color.RGBA{255, 255, 255, 255}, func(x, y int) bool { if x == y { return true } return false }} pic.ShowImage(m) }
func main() { m := NewImage(255, 255, func(a, b int) uint8 { return uint8(a * b) }) pic.ShowImage(m) }
func main() { m := Image{} pic.ShowImage(m) }
func main() { m := Image{500, 500} pic.ShowImage(&m) }
func main() { m := Image{256, 256} pic.ShowImage(m) }
func main() { m := makePic(200, 100, valueOfPointer) // 调用pic类的ShowImage来显示生成的图片 pic.ShowImage(m) }