本文整理汇总了Golang中code/google/com/p/go-tour/pic.ShowImage函数的典型用法代码示例。如果您正苦于以下问题:Golang ShowImage函数的具体用法?Golang ShowImage怎么用?Golang ShowImage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ShowImage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: main
func main() {
m := Image{}
m.h = 50
m.w = 100
m.rgba = color.RGBA{1, 155, 255, 55}
pic.ShowImage(m)
}
示例2: main
func main() {
m := Image{
128,
128,
func(x, y int) (val uint8) { return uint8(4 * (x + y)) },
func(x, y int) (val uint8) { return uint8(x) },
func(x, y int) (val uint8) { return uint8(y) },
}
pic.ShowImage(m)
}
示例3: main
func main() {
m := Image{w: 1024, h: 1024, model: color.RGBAModel}
m.px = make([][]uint8, m.w)
for y := 0; y < m.w; y++ {
m.px[y] = make([]uint8, m.h)
for x := 0; x < m.h; x++ {
m.px[y][x] = uint8(x + y)
}
}
pic.ShowImage(&m)
}
示例4: main
func main() {
rand.Seed(time.Now().Unix())
x, y := 100, 100
img := make([][]Pixel, x)
for i := 0; i < x; i++ {
img[i] = make([]Pixel, y)
for j := 0; j < y; j++ {
img[i][j] = Pixel{uint8(rand.Intn(255)),
uint8(rand.Intn(255)),
uint8(rand.Intn(255)),
255}
}
}
m := Image{x, y, img}
pic.ShowImage(m)
}
示例5: main
func main() {
_, trace := getHeader("/home/taysom/tau/tau.pj/go.t/tour.d/a-meta")
dy := divup(maxblock(trace), dx)
m := Image{image.Rect(0, 0, dx, dy), make([][dx]bool, dy)}
for _, t := range trace {
for j := 0; j < int(t.Count); j++ {
block := int(t.Block) + j
y := block / dx
x := block % dx
m.Used[y][x] = true
}
}
if false {
pic.ShowImage(m)
} else {
fmt.Println(dx, dy)
}
}
示例6: main
func main() {
m := Image{width: 500, height: 500}
pic.ShowImage(m)
}
示例7: main
func main() {
m := &Image{100, 100}
pic.ShowImage(m)
}
示例8: main
func main() {
m := Image{200, 200}
pic.ShowImage(m)
}
示例9: main
func main() {
m := Image{w: 100, h: 100}
pic.ShowImage(m)
}
示例10: main
func main() {
m := &Image{50, 50, 200, 200, 100}
pic.ShowImage(m)
}
示例11: main
func main() {
m := Image{10, 10}
pic.ShowImage(&m)
}
示例12: main
func main() {
m := Image{255, 255, power}
pic.ShowImage(m)
}
示例13: main
func main() {
m := Image{10, 10}
// it passes 'm' directly so we need to use (i Image) in above interface declaration.
pic.ShowImage(m)
}
示例14: main
func main() {
m := Image{image.Rect(0, 0, 255, 255)}
pic.ShowImage(m)
}
示例15: main
func main() {
m := Image{100, 80}
pic.ShowImage(m)
}