roundimage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	gtk.Image
	Radius float64
	// contains filtered or unexported fields
}

Image represents an image with abstractions for asynchronously fetching images from a URL as well as having interchangeable fallbacks.

func NewImage

func NewImage(radius float64) *Image

NewImage creates a new round image. If radius is 0, then it will be half the dimensions. If the radius is less than 0, then nothing is rounded.

func (*Image) Clear

func (i *Image) Clear()

func (*Image) Clip

func (i *Image) Clip(cc *cairo.Context)

Clip clips the image from the Cairo context.

func (*Image) Initials

func (i *Image) Initials() string

func (*Image) SetFromAnimation

func (i *Image) SetFromAnimation(p *gdkpixbuf.PixbufAnimation)

func (*Image) SetFromPixbuf

func (i *Image) SetFromPixbuf(p *gdkpixbuf.Pixbuf)

func (*Image) SetFromSurface

func (i *Image) SetFromSurface(s *cairo.Surface)

func (*Image) SetInitials

func (i *Image) SetInitials(initials string)

func (*Image) SetRadius

func (i *Image) SetRadius(r float64)

SetRadius sets the radius to be drawn with. If 0 is given, then a full circle is drawn, which only works best for images guaranteed to be square. Otherwise, the radius is either the number given or the minimum of either the width or height.

Jump to

Keyboard shortcuts

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