monomer-1.0.0.0: A GUI library for writing native Haskell applications.
Copyright(c) 2018 Francisco Vallarino
LicenseBSD-3-Clause (see the LICENSE file)
Maintainerfjvallarino@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Monomer.Widgets.Singles.Image

Description

Displays an image from local storage or a url.

Notes:

  • Depending on the type of image fit chosen and the assigned viewport, some space may remain unused. The alignment options exist to handle this situation.
  • If you choose fitNone, imageRepeatX and imageRepeatY won't have any kind of effect.

Configs:

  • transparency: the alpha to apply when rendering the image.
  • onLoadError: an event to report a load error.
  • imageNearest: apply nearest filtering when stretching an image.
  • imageRepeatX: repeat the image across the x coordinate.
  • imageRepeatY: repeat the image across the y coordinate.
  • fitNone: does not perform any streching if the size does not match viewport.
  • fitFill: stretches the image to match the viewport.
  • fitWidth: stretches the image to match the viewport width. Maintains ratio.
  • fitHeight: stretches the image to match the viewport height. Maintains ratio.
  • alignLeft: aligns left if extra space is available.
  • alignRight: aligns right if extra space is available.
  • alignCenter: aligns center if extra space is available.
  • alignTop: aligns top if extra space is available.
  • alignMiddle: aligns middle if extra space is available.
  • alignBottom: aligns bottom if extra space is available.
Synopsis

Documentation

data ImageLoadError Source #

Posible errors when loading an image.

image :: WidgetEvent e => Text -> WidgetNode s e Source #

Creates an image with the given local path or url.

image_ :: WidgetEvent e => Text -> [ImageCfg e] -> WidgetNode s e Source #

Creates an image with the given local path or url. Accepts config.

imageMem Source #

Arguments

:: WidgetEvent e 
=> Text

The logical name of the image.

-> ByteString

The image data as 4-byte RGBA blocks.

-> Size

The size of the image.

-> WidgetNode s e

The created image widget.

Creates an image with the given binary data.

imageMem_ Source #

Arguments

:: WidgetEvent e 
=> Text

The logical name of the image.

-> ByteString

The image data as 4-byte RGBA blocks.

-> Size

The size of the image.

-> [ImageCfg e]

The configuration of the image.

-> WidgetNode s e

The created image widget.

Creates an image with the given binary data. Accepts config.