Go语言中文网 为您找到相关结果 2

使用Go语言画图,基础图

这个事例使用了一个简单的画图,并将其写入到http的包里面,只需几步, 打开http://localhost:999/即可看到, 其它还在研究当中, 研究出来自然跟大家分享. package main import ( "image" "image/color" "image/draw" "image/png" "net/http" ) var ( blue color.Color = color.RGBA{0, 0, 255, 255} picwidth int = 640 picheight int = 480 ) // 大家可以查看这个网址看看这个image包的使用方法 http://golang.org/doc/articles/image_draw.html func main()...阅读全文

博文 2015-06-17 23:02:39 movoco

用xgb和freetype-go建立窗口并画图

最近一直在鼓捣怎样用golang画图(不想用cgo来封装c库),终于找到了xgb和freetype-go。 xgb可以用来创建窗口,freetype-go中的raster库可以用来画图。 下面我用它们写了一个简单的程序,它在窗口中画了个90度的扇形 package main import ( "code.google.com/p/freetype-go/freetype/raster" "fmt" "github.com/BurntSushi/xgbutil" "github.com/BurntSushi/xgbutil/xevent" "github.com/BurntSushi/xgbutil/xgraphics" "...阅读全文