svg

package
v0.0.0-...-fa5f906 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package svg 提供基于 svg 的绘图工具

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

type Canvas struct {
	// contains filtered or unexported fields
}

Canvas 表示一个 svg 画布

func NewCanvas

func NewCanvas[T1, T2 draw.Number](width T1, height T2) *Canvas

新建一个 svg 画布

func (*Canvas) CurrentDrawColor

func (c *Canvas) CurrentDrawColor() color.Color

CurrentDrawColor 返回当前的颜色

func (*Canvas) DrawHollowCircle

func (c *Canvas) DrawHollowCircle(center draw.Point, radius, width float64)

DrawHollowCircle 绘制一个空心圆

func (*Canvas) DrawHollowPolygon

func (c *Canvas) DrawHollowPolygon(width float64, endpoints ...draw.Point)

DrawHollowPolygon 绘制一个空心多边形

func (*Canvas) DrawHollowRect

func (c *Canvas) DrawHollowRect(from, to draw.Point, width float64)

DrawHollowRect 绘制一个空心矩形

func (*Canvas) DrawLine

func (c *Canvas) DrawLine(from, to draw.Point, width float64)

DrawLine 绘制一条线

func (*Canvas) DrawPoint

func (c *Canvas) DrawPoint(center draw.Point, radius float64)

DrawPoint 绘制一个实心圆

func (*Canvas) DrawSolidPolygon

func (c *Canvas) DrawSolidPolygon(endpoints ...draw.Point)

DrawHollowPolygon 绘制一个空心多边形

func (*Canvas) DrawSolidRect

func (c *Canvas) DrawSolidRect(from, to draw.Point)

DrawSolidRect 绘制一个实心矩形

func (*Canvas) DrawText

func (c *Canvas) DrawText(origin draw.Point, text string, opts ...draw.Option)

func (*Canvas) Save

func (c *Canvas) Save(filepath string) error

Save 关闭并保存到文件

func (*Canvas) SetDrawColor

func (c *Canvas) SetDrawColor(clr color.Color)

SetDrawColor 设置后续的绘制颜色

func (*Canvas) Size

func (c *Canvas) Size() (width, height float64)

Size 返回画布大小

Jump to

Keyboard shortcuts

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