Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Composable ¶
type Composable = api.Composable
func Image ¶
func Image(imageResource ImageResource, options ...ImageOption) Composable
type ImageOption ¶
type ImageOption func(*ImageOptions)
func WithAlignment ¶
func WithAlignment(alignment size.Alignment) ImageOption
func WithAlpha ¶
func WithAlpha(alpha float32) ImageOption
func WithContentScale ¶
func WithContentScale(contentScale uilayout.ContentScale) ImageOption
func WithModifier ¶
func WithModifier(m ui.Modifier) ImageOption
type ImageOptions ¶
type ImageOptions struct {
Modifier ui.Modifier
Alignment size.Alignment
ContentScale uilayout.ContentScale
Alpha float32
}
func DefaultImageOptions ¶
func DefaultImageOptions() ImageOptions
type ImageResource ¶
type ImageResource = graphics.ImageResource
type ImageWidget ¶
type ImageWidget struct {
// Src is the image to display.
Src paint.ImageOp
// ContentScale specifies how to scale the image to the constraints.
ContentScale layout.ContentScale
// Alignment specifies where to position the image within the constraints.
Alignment size.Alignment
// Alpha applies opacity to the image (0.0 to 1.0).
Alpha float32
}
ImageWidget is a widget that displays an image with scaling, alignment, and opacity.
func (ImageWidget) Layout ¶
func (im ImageWidget) Layout(gtx layoutnode.LayoutContext) layoutnode.LayoutDimensions
Click to show internal directories.
Click to hide internal directories.