示例#1
0
// Returns a new canvas object.
func New() *Canvas {
	cv := &Canvas{}

	cv.Init()

	cv.wand = C.NewMagickWand()

	cv.fg = C.NewPixelWand()
	cv.bg = C.NewPixelWand()

	cv.fill = C.NewPixelWand()
	cv.stroke = C.NewPixelWand()

	cv.drawing = C.NewDrawingWand()

	//cv.SetColor("#ffffff")
	cv.SetBackgroundColor("none")

	cv.SetStrokeColor("#ffffff")
	cv.SetStrokeAntialias(true)
	cv.SetStrokeWidth(1.0)
	cv.SetStrokeOpacity(1.0)
	cv.SetStrokeLineCap(STROKE_ROUND_CAP)
	cv.SetStrokeLineJoin(STROKE_ROUND_JOIN)

	//cv.SetFillRule(FILL_EVEN_ODD_RULE)
	cv.SetFillColor("#888888")

	return cv
}
示例#2
0
文件: canvas.go 项目: phacops/canvas
// Returns a new canvas object.
func New() *Canvas {
	self := &Canvas{}

	self.wand = C.NewMagickWand()
	self.drawing = C.NewDrawingWand()

	self.fg = C.NewPixelWand()
	self.bg = C.NewPixelWand()

	self.fill = C.NewPixelWand()
	self.stroke = C.NewPixelWand()

	self.SetBackgroundColor("none")

	self.SetStrokeColor("#ffffff")
	//self.SetStrokeAntialias(true)
	//self.SetStrokeWidth(1.0)
	//self.SetStrokeOpacity(1.0)
	//self.SetStrokeLineCap(STROKE_ROUND_CAP)
	//self.SetStrokeLineJoin(STROKE_ROUND_JOIN)

	self.SetFillColor("#000000")

	return self
}
示例#3
0
// Returns a new canvas object.
func New() *Canvas {
	self := &Canvas{}

	self.wand = C.NewMagickWand()

	self.fg = C.NewPixelWand()
	self.bg = C.NewPixelWand()

	self.fill = C.NewPixelWand()
	self.stroke = C.NewPixelWand()

	self.drawing = C.NewDrawingWand()

	//self.SetColor("#ffffff")
	self.SetBackgroundColor("none")

	self.SetStrokeColor("#ffffff")
	self.SetStrokeAntialias(true)
	self.SetStrokeWidth(1.0)
	self.SetStrokeOpacity(1.0)
	self.SetStrokeLineCap(STROKE_ROUND_CAP)
	self.SetStrokeLineJoin(STROKE_ROUND_JOIN)

	//self.SetFillRule(FILL_EVEN_ODD_RULE)
	self.SetFillColor("#888888")

	self.text = self.NewTextProperties(true)

	return self
}
示例#4
0
// Returns a drawing wand required for all other methods in the API.
func NewDrawingWand() *DrawingWand {
	return &DrawingWand{C.NewDrawingWand()}
}