Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
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
andimageRepeatY
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
- data ImageLoadError
- image :: WidgetEvent e => Text -> WidgetNode s e
- image_ :: WidgetEvent e => Text -> [ImageCfg e] -> WidgetNode s e
- imageMem :: WidgetEvent e => Text -> ByteString -> Size -> WidgetNode s e
- imageMem_ :: WidgetEvent e => Text -> ByteString -> Size -> [ImageCfg e] -> WidgetNode s e
Documentation
data ImageLoadError Source #
Posible errors when loading an image.
Instances
Eq ImageLoadError Source # | |
Defined in Monomer.Widgets.Singles.Image (==) :: ImageLoadError -> ImageLoadError -> Bool # (/=) :: ImageLoadError -> ImageLoadError -> Bool # | |
Show ImageLoadError Source # | |
Defined in Monomer.Widgets.Singles.Image showsPrec :: Int -> ImageLoadError -> ShowS # show :: ImageLoadError -> String # showList :: [ImageLoadError] -> ShowS # |
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.
:: 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.
:: 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.