troylelandshields / drawing

Simple drawing package that is similar to the drawing available on https://goplay.space/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About & GoDoc

GoDoc

The drawing package is very much inspired by the drawing capabilities on http://goplay.space, but allows you to take the Gopher artist to your local machine so that you can save images to disk.

Getting Started

Install package with go get -u github.com/troylelandshields/drawing.

To start drawing an image, you must first call the NewCanvas function with the desired height and width.

You must call canvas.SaveImage(fileName) when you have finished drawing to save the canvas to an image file.

canvas := drawing.NewCanvas(1000, 1000)

// ... draw on the canvas

err := canvas.SaveImage("out.png")
if err != nil {
    fmt.Println("Error saving image:", err)
}

Example Drawings

There are examples in the ./examples folder that can be useful to see more about how to use the drawing package.

About

Simple drawing package that is similar to the drawing available on https://goplay.space/


Languages

Language:Go 100.0%