3.3.5 Controls
3.3.5.1 Button
3.3.5.2 Checkbox
3.3.5.3 Choice
3.3.5.4 Radio  Choice
3.3.5.5 List  Choice
3.3.5.6 Table
3.3.5.7 Slider
3.3.5.8 Progress
3.3.5.9 Input
3.3.5.10 Label
3.3.5.11 Image
3.3.5.12 Spacer
On this page:
Image
Image.Display  Mode
Image.Display  Mode.fit
Image.Display  Mode.fill

image

class

class gui.Image():

  implements WindowChildView

  constructor (

    content :: ObsOrValue.of(PathString || draw.Bitmap),

    ~size: size :: ObsOrValue.of(View.Size) = [#false, #false],

    ~display: display :: ObsOrValue.of(Image.DisplayMode) = #'fit,

    ~margin: margin :: ObsOrValue.of(View.Margin) = [2, 2],

    ~min_size: min_size :: ObsOrValue.of(View.Size) = [#false, #false],

    ~stretch: stretch :: ObsOrValue.of(View.Stretch) = [#true, #true],

    ~window_callbacks: window_callbacks :: maybe(WindowCallbacks) = #false

  )

Creates a bitmap image display showing either a draw.Bitmap instance or one that is loaded from a specified file path.

When size has #false for a dimension, then the size of content is used. Within that size, the image is either scaled to fit in both dimensions when display is #'fit, or it is stretched to fill in both dimensions when display is #'fill.

If the image view has a different size based on min_size and stretch, then the image is centered within the view’s area.

enumeration

enum Image.DisplayMode

| fit

| fill

Scaling options for Image.