gifanim

package
v2.4.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DisposalNone = iota + 1
	DisposalBackground
	DisposalPrevious
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Frame

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

func (*Frame) Data

func (m *Frame) Data() []byte

func (*Frame) Delay

func (m *Frame) Delay() uint32

func (*Frame) Image

func (m *Frame) Image() lcl.IBitmap

func (*Frame) Index

func (m *Frame) Index() int

func (*Frame) Point

func (m *Frame) Point() (x, y int32)

func (*Frame) Rect

func (m *Frame) Rect() (width, height int32)

func (*Frame) SetData

func (m *Frame) SetData(data []byte)

func (*Frame) SetDelay

func (m *Frame) SetDelay(delay uint32)

func (*Frame) SetPoint

func (m *Frame) SetPoint(x, y int32)

func (*Frame) SetRect

func (m *Frame) SetRect(width, height int32)

type TGIFAnimate

type TGIFAnimate struct {
	*ext.TImage
	// contains filtered or unexported fields
}

TGIFAnimate

GIF 动画组件

func NewGIFAnimate

func NewGIFAnimate(owner lcl.IComponent) *TGIFAnimate

NewGIFAnimate

创建GIF动画播放组件

func (*TGIFAnimate) Animate

func (m *TGIFAnimate) Animate() bool

Animate 返回当前GIF播放或停止

func (*TGIFAnimate) CurrentFrameIndex

func (m *TGIFAnimate) CurrentFrameIndex() int

CurrentFrameIndex 返回当前帧索引

func (*TGIFAnimate) EnableCache

func (m *TGIFAnimate) EnableCache(v bool)

EnableCache 启用缓存

func (*TGIFAnimate) Frame

func (m *TGIFAnimate) Frame(index int) *Frame

Frame 返回指定索引帧

func (*TGIFAnimate) FrameCount

func (m *TGIFAnimate) FrameCount() int

FrameCount 返回帧总数

func (*TGIFAnimate) Free

func (m *TGIFAnimate) Free()

func (*TGIFAnimate) LoadFromBytes

func (m *TGIFAnimate) LoadFromBytes(data []byte)

LoadFromBytes 从字节数组加载GIF

func (*TGIFAnimate) LoadFromFile

func (m *TGIFAnimate) LoadFromFile(filePath string)

LoadFromFile 从本地文件加载GIF

func (*TGIFAnimate) NextFrame

func (m *TGIFAnimate) NextFrame()

NextFrame 播放下一帧

func (*TGIFAnimate) PrevFrame

func (m *TGIFAnimate) PrevFrame()

PrevFrame 播放上一帧

func (*TGIFAnimate) ReadHeader

func (m *TGIFAnimate) ReadHeader(data []byte) *TGIFHeader

func (*TGIFAnimate) SetAnimate

func (m *TGIFAnimate) SetAnimate(v bool)

SetAnimate 设置GIF播放或停止

func (*TGIFAnimate) SetOnFrameChanged

func (m *TGIFAnimate) SetOnFrameChanged(fn func(frame *Frame))

SetOnFrameChanged 播放每帧改变事件

func (*TGIFAnimate) SetOnStart

func (m *TGIFAnimate) SetOnStart(fn func())

SetOnStart 开始播放事件

func (*TGIFAnimate) SetOnStop

func (m *TGIFAnimate) SetOnStop(fn func())

SetOnStop 停止播放事件

func (*TGIFAnimate) Start

func (m *TGIFAnimate) Start()

Start 开始播放

func (*TGIFAnimate) Stop

func (m *TGIFAnimate) Stop()

Stop 停止播放

type TGIFHeader

type TGIFHeader struct {
	Signature       [3]byte // 页眉签名(始终为“GIF”)
	Version         [3]byte // GIF格式版本(“89a”)
	ScreenWidth     uint16  // 以像素为单位的显示屏宽度
	ScreenHeight    uint16  // 以像素为单位的显示屏高度
	Packedbit       byte    // 屏幕和彩色地图信息
	BackgroundColor byte    // 背景色索引
	AspectRatio     byte    // 像素纵横比
}

func (*TGIFHeader) Is89a

func (m *TGIFHeader) Is89a() bool

func (*TGIFHeader) IsGIF

func (m *TGIFHeader) IsGIF() bool

Jump to

Keyboard shortcuts

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