package main
import (
"fmt"
"image/color"
"io"
"os"
"github.com/zijiren233/go-text2picture"
)
func main() {
pic := text2picture.NewPictureWithBackGround(text2picture.NewColorPicture(500, 100, text2picture.White), 320, 10, 5)
pic.DrawWithBlack("test 123\n4321...")
pic.DrawWithColor(text2picture.Red, "test color ... ")
pic.PointOffset(0, float64(pic.NextLineDistance()))
pic.DrawWithBlack("test offset")
pic.DrawWithBlack(" test auto newline")
f, err := os.OpenFile("./test.png", os.O_CREATE|os.O_WRONLY|os.O_TRUNC, os.ModePerm)
if err != nil {
fmt.Println(err)
return
}
defer f.Close()
io.Copy(f, pic.GeneratePicture())
}
-
Notifications
You must be signed in to change notification settings - Fork 0
Golang simple text to text to picture
License
zijiren233/go-text2picture
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Golang simple text to text to picture
Topics
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published