本文整理汇总了Golang中golang.org/x/tour/pic.ShowImage函数的典型用法代码示例。如果您正苦于以下问题:Golang ShowImage函数的具体用法?Golang ShowImage怎么用?Golang ShowImage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ShowImage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: main
func main() {
/* Choose the color function by changing the closure below
* Interesting functions include x^y, x*y and (x+y)/2
*/
m := Image{257, 257, func(x, y int) uint8 { return uint8(x * y) }}
pic.ShowImage(m)
}
示例2: main
func main() {
m := Image{width: 200, height: 200}
m.Initialize()
m.Draw()
pic.ShowImage(&m)
//fmt.Println(m.image)
}
示例3: ExerciseImages
func ExerciseImages() {
m := Image{
W: 100,
H: 100,
}
pic.ShowImage(m)
}
示例4: main
func main() {
m := Image{}
m.x = 0
m.y = 0
m.w = 100
m.h = 100
pic.ShowImage(m)
}
示例5: main
func main() {
m := Image{
256,
256,
func(x, y int) uint8 {
return uint8((x + y) / 2)
},
}
pic.ShowImage(m)
}
示例6: main
func main() {
m := &Image{
x: 100,
y: 200,
r: 255,
g: 128,
b: 128,
a: 255,
}
pic.ShowImage(m)
}
示例7: main
func main() {
haha := make([][]byte, 100)
for i := range haha {
haha[i] = make([]byte, 100)
}
for i := range haha {
for j := range haha[i] {
haha[i][j] = byte(i * j * i)
}
}
m := Image{100, 100, haha}
pic.ShowImage(m)
}
示例8: main
func main() {
m := Image{256, 256}
pic.ShowImage(m)
}
示例9: imageTester
func imageTester() {
m := image.NewRGBA(image.Rect(0, 0, 100, 100))
fmt.Println("Bounds = ", m.Bounds())
fmt.Println(m.At(0, 0).RGBA())
pic.ShowImage(m)
}
示例10: main
func main() {
m := Image{100, 200, 200}
pic.ShowImage(&m)
}
示例11: main
func main() {
m := Image{200, 200, 255}
pic.ShowImage(&m)
}
示例12: TestImage2
func TestImage2(t *testing.T) {
m := Image{100, 100}
pic.ShowImage(m)
}
示例13: main
func main() {
m := Image{Pic(100, 100)}
pic.ShowImage(m)
}
示例14: main
func main() {
m := Image{50, 80, 120}
pic.ShowImage(&m)
}
示例15: main
func main() {
//sq := func(x, y, w, h int) int { return x * y }
pic.ShowImage(&Image{500, 500, mandelbrot})
}