Ejemplo n.º 1
0
Archivo: gc.go Proyecto: stanim/draw2d
// NewGraphicContext creates a new Graphic context from an image.
func NewGraphicContext(width, height int) *GraphicContext {
	gc := &GraphicContext{
		draw2d.NewStackGraphicContext(),
		NewPainter(),
		raster.NewRasterizer(width, height),
		raster.NewRasterizer(width, height),
	}
	return gc
}
Ejemplo n.º 2
0
Archivo: gc.go Proyecto: stanim/draw2d
// NewGraphicContext creates a new pdf GraphicContext
func NewGraphicContext(pdf *gofpdf.Fpdf) *GraphicContext {
	gc := &GraphicContext{draw2d.NewStackGraphicContext(), pdf, DPI}
	gc.SetDPI(DPI)
	return gc
}