imgview

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ImgViewProps = ki.Props{
	"EnumType:Flag": gi.KiT_NodeFlags,
	"max-width":     -1,
	"max-height":    -1,
}
View Source
var KiT_ImgView = kit.Types.AddType(&ImgView{}, ImgViewProps)

Functions

This section is empty.

Types

type ImgView

type ImgView struct {
	gi.Bitmap

	// info about the image that is being viewed
	Info *picinfo.Info `desc:"info about the image that is being viewed"`

	// cached version of original image
	OrigImg image.Image `desc:"cached version of original image"`

	// current scale
	Scale float32 `desc:"current scale"`
}

ImgView shows a bitmap image with zoom control through keyboard actions

func AddNewImgView

func AddNewImgView(parent ki.Ki, name string) *ImgView

AddNewImgView adds a new ImgView to given parent node, with given name.

func (*ImgView) ConnectEvents2D

func (iv *ImgView) ConnectEvents2D()

func (*ImgView) ImgViewEvents

func (iv *ImgView) ImgViewEvents()

func (*ImgView) ImgViewMouseEvents

func (iv *ImgView) ImgViewMouseEvents()

func (*ImgView) KeyInput

func (iv *ImgView) KeyInput(kt *key.ChordEvent)

func (*ImgView) ScaleToFit

func (iv *ImgView) ScaleToFit()

ScaleToFit sets the scale so it fits the current image

func (*ImgView) SetInfo

func (iv *ImgView) SetInfo(pi *picinfo.Info)

SetInfo sets the image info

func (*ImgView) UpdateImage

func (iv *ImgView) UpdateImage()

UpdateImage updates the image based on current scale

func (*ImgView) ZoomIn

func (iv *ImgView) ZoomIn()

ZoomIn magnifies scale of image (makes it larger)

func (*ImgView) ZoomOut

func (iv *ImgView) ZoomOut()

ZoomOut reduces scale of image (makes it smaller)

Jump to

Keyboard shortcuts

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