
|
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.
Scaling options for
Image.