Draw a rectangle in Golang?

前端 未结 4 1063
暗喜
暗喜 2020-12-05 02:47

I want to draw a mailing label with some rectangles, barcodes, and then finally generate a PNG/PDF file.

Is there is a better way to draw a shape in Go other than to

4条回答
  •  感动是毒
    2020-12-05 03:27

    My noob shot at drawing a rectangle of given line thickness. Still primitive

    func Rect(x1, y1, x2, y2, thickness int, img *image.RGBA) {
        col := color.RGBA{0, 0, 0, 255}
    
        for t:=0; t

提交回复
热议问题