image

package
v0.0.0-...-3311072 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendImpl

type BackendImpl struct {
	Client
}

BackendImpl ...

func NewImageBackend

func NewImageBackend(cfg *Config, wxClient wx.IWXClient) (*BackendImpl, error)

NewImageBackend ...

type Client

type Client struct {
	ImageConfig *Config
	Bg          *image.NRGBA
	Font        *freetype.Context
	FontType    *truetype.Font
	WXClient    wx.IWXClient
}

Client image services client

func (*Client) CreateDonationImage

func (c *Client) CreateDonationImage(content []string, appID string, secret string, scene string, isShare bool) (*image.NRGBA, error)

CreateDonationImage create new image of donation items

func (*Client) CreateWXQrCode

func (c *Client) CreateWXQrCode(appID string, secret string, scene string) (img image.Image, err error)

CreateWXQrCode create a wx qr code

func (*Client) DrawText

func (c *Client) DrawText(fontColor color.Color, str string, pt fixed.Point26_6, size float64) error

DrawText define string drawing

func (*Client) Init

func (c *Client) Init() error

Init initializes a new background image

func (*Client) SlipString

func (c *Client) SlipString(content string, fontSize float64, textWidth int) []string

SlipString handles line breaks of strings

type Config

type Config struct {
	BackgroundPath string
	FontPath       string
}

Config draw the configuration of block chain storage certificate

type IImageBackend

type IImageBackend interface {
	Init() error
	CreateDonationImage(content []string, appID string, secret string, scene string, isShare bool) (*image.NRGBA, error)
}

IImageBackend ...

Directories

Path Synopsis
Package mock_backend is a generated GoMock package.
Package mock_backend is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL