imageview

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package button implements a view that can display an image.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResizeMode

type ResizeMode int
const (
	// The image is resized proportionally such that a single axis is filled.
	ResizeModeFit ResizeMode = iota
	// The image is resized proportionally such that the entire view is filled.
	ResizeModeFill
	// The image is stretched to fill the view.
	ResizeModeStretch
	// The image is centered in the view with its natural size.
	ResizeModeCenter
)

func (ResizeMode) MarshalProtobuf

func (m ResizeMode) MarshalProtobuf() imageview.ResizeMode

type View

type View struct {
	view.Embed
	Image      image.Image
	ResizeMode ResizeMode
	Tint       color.Color
	PaintStyle *paint.Style
	// contains filtered or unexported fields
}

func New

func New(ctx *view.Context, key string) *View

New returns either the previous View in ctx with matching key, or a new View if none exists.

func (*View) Build

func (v *View) Build(ctx *view.Context) view.Model

Build implements view.View.

Jump to

Keyboard shortcuts

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