Line

Draw a line in the image.

Parameters

Parameter
Type
Description

x1

int

X-Coordinate of one of the endpoint of the line.

y1

int

Y-Coordinate of one of the endpoint of the line.

x2

int

X-Coordinate of the other endpoint of the line.

y2

int

Y-Coordinate of the other endpoint of the line.

c

color.Color

Color of the line.

Return Values

The instance of *imgo.Image .

Examples

package main

import (
    "github.com/fishtailstudio/imgo"
    "image/color"
)

func main() {
    imgo.Canvas(300, 300, color.White).
        Line(10, 10, 200, 250, color.Black).
        Save("out.png")
}

Last updated