1
0
forked from MTSR/mapserver
mapserver/tilerenderer/blank.go
2019-06-13 08:04:32 +02:00

25 lines
386 B
Go

package tilerenderer
import (
"bytes"
"image"
"image/color"
"image/draw"
"image/png"
)
func CreateBlankTile(c color.RGBA) []byte {
rect := image.Rectangle{
image.Point{0, 0},
image.Point{IMG_SIZE, IMG_SIZE},
}
img := image.NewNRGBA(rect)
draw.Draw(img, rect, &image.Uniform{c}, image.ZP, draw.Src)
buf := new(bytes.Buffer)
png.Encode(buf, img)
return buf.Bytes()
}