Documentation
¶
Index ¶
- Constants
- func CLI(args []string) int
- type AppEnv
- func (app *AppEnv) AddDefaultText(text string) error
- func (app *AppEnv) AddTitle(title string) error
- func (app *AppEnv) LoadFontFace(fontBytes []byte, points float64) error
- func (app *AppEnv) LoadImage(inputImage string) (image.Image, error)
- func (app *AppEnv) RenderImage(img image.Image)
- func (app *AppEnv) SaveImage(outputFileName string) error
Constants ¶
View Source
const ( // InputImage holds the path to the background image InputImage = "./background.jpg" // Output Path for the generated image OutputImage = "./social-media-banner.png" // default text (domain name) DefaultText = "https://www.rockyourcode.com" // Title Title = "Programmatically generate social media images in Go" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppEnv ¶
type AppEnv struct {
// contains filtered or unexported fields
}
AppEnv holds the local context for the application.
func (*AppEnv) AddDefaultText ¶
Add default text (domain name)
func (*AppEnv) LoadFontFace ¶
LoadFontFace loads the specified font into the draw context.
func (*AppEnv) RenderImage ¶
Render image with semi-transparent overlay
Click to show internal directories.
Click to hide internal directories.