Header menu logo fable-electron-docs-api

ImageView Type

⚠ Process Availability: Main ✔ | Renderer ❌ | Utility ❌ | Exported ✔

A View that displays an image.Process: MainThis module cannot be used until the ready event of the app module is emitted.Useful for showing splash screens that will be swapped for WebContentsViews when the content finishes loading.Note that ImageView is experimental and may be changed or removed in the future.### Class: ImageView extends View> A View that displays an image.Process: MainImageView inherits from View.ImageView is an EventEmitter.> [!WARNING] Electron's built-in classes cannot be subclassed in user code. For more information, see the FAQ.

Constructors

Constructor Description

ImageView()

Full Usage: ImageView()

Returns: ImageView
Returns: ImageView

Instance members

Instance member Description

this.addChildView (view, ?index)

Full Usage: this.addChildView (view, ?index)

Parameters:
    view : View
    ?index : int

Modifiers: inline

If the same View is added to a parent which already contains it, it will be reordered such that it becomes the topmost view.

view : View
?index : int

this.children

Full Usage: this.children

Returns: View[]

A View[] property representing the child views of this view.

Returns: View[]

this.getBounds ()

Full Usage: this.getBounds ()

Returns: Rectangle
Modifiers: inline

The bounds of this View, relative to its parent.

Returns: Rectangle

this.getVisible ()

Full Usage: this.getVisible ()

Returns: bool
Modifiers: inline

Whether the view should be drawn. Note that this is different from whether the view is visible on screen—it may still be obscured or out of view.

Returns: bool

this.offBoundsChanged handler

Full Usage: this.offBoundsChanged handler

Parameters:
    handler : unit -> unit

Modifiers: inline

Emitted when the view's bounds have changed in response to being laid out. The new bounds can be retrieved with view.getBounds().

handler : unit -> unit

this.onBoundsChanged handler

Full Usage: this.onBoundsChanged handler

Parameters:
    handler : unit -> unit

Modifiers: inline

Emitted when the view's bounds have changed in response to being laid out. The new bounds can be retrieved with view.getBounds().

handler : unit -> unit

this.onceBoundsChanged handler

Full Usage: this.onceBoundsChanged handler

Parameters:
    handler : unit -> unit

Modifiers: inline

Emitted when the view's bounds have changed in response to being laid out. The new bounds can be retrieved with view.getBounds().

handler : unit -> unit

this.removeChildView view

Full Usage: this.removeChildView view

Parameters:
Modifiers: inline

If the view passed as a parameter is not a child of this view, this method is a no-op.

view : View

this.setBackgroundColor color

Full Usage: this.setBackgroundColor color

Parameters:
    color : string

Modifiers: inline

Examples of valid color values:* Hex * #fff (RGB) * #ffff (ARGB) * #ffffff (RRGGBB) *

ffffffff (AARRGGBB)* RGB * rgb(([\d]+),\s*([\d]+),\s*([\d]+)) * e.g. rgb(255, 255, 255)* RGBA * rgba(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+))

  • e.g. rgba(255, 255, 255, 1.0)* HSL * hsl((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%) * e.g. hsl(200, 20%, 50%)* HSLA
  • hsla((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)) * e.g. hsla(200, 20%, 50%, 0.5)* Color name * Options are listed in SkParseColor.cpp * Similar to CSS Color Module Level 3 keywords, but case-sensitive. * e.g. blueviolet or red> [!NOTE] Hex format with alpha takes AARRGGBB or ARGB, not RRGGBBAA or RGB.

color : string

this.setBorderRadius radius

Full Usage: this.setBorderRadius radius

Parameters:
    radius : int

Modifiers: inline

[!NOTE] The area cutout of the view's border still captures clicks.

radius : int

this.setBounds bounds

Full Usage: this.setBounds bounds

Parameters:
Modifiers: inline
bounds : Rectangle

this.setImage image

Full Usage: this.setImage image

Parameters:
Modifiers: inline

Sets the image for this ImageView. Note that only image formats supported by NativeImage can be used with an ImageView.

image : NativeImage

this.setVisible visible

Full Usage: this.setVisible visible

Parameters:
    visible : bool

Modifiers: inline
visible : bool

Type something to start searching.