Class

org.scalafx.extras.image

ImageDisplay

Related Doc: package image

Permalink

class ImageDisplay extends AnyRef

Displays an image view with ability to zoom in, zoom out, zoom to fit. It can also automatically resizes to parent size. When zoomToFit is set to true the image is sized to fit the parent scroll pane.

Sample usage (full detains in ImageDisplayDemoApp)

object ImageDisplayDemoApp extends JFXApp {

  private val imageDisplay = new ImageDisplay()

  stage = new PrimaryStage {
    scene = new Scene(640, 480) {
      title = "ImageDisplay Demo"
      root = new BorderPane {
        top = new ToolBar {
          items = Seq(
            new Button("Open...") {
              onAction = () => onFileOpen()
            },
            new Button("Zoom In") {
              onAction = () => imageDisplay.zoomIn()
              disable <== imageDisplay.zoomToFit
            },
            new Button("Zoom Out") {
              onAction = () => imageDisplay.zoomOut()
              disable <== imageDisplay.zoomToFit
            },
            new ToggleButton("Zoom to fit") {
              selected <==> imageDisplay.zoomToFit
            }
          )
        }
        center = imageDisplay.view
      }
    }
  }
}
Source
ImageDisplay.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ImageDisplay
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ImageDisplay()

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val actualZoom: ReadOnlyDoubleProperty

    Permalink

    Actual zoom value.

    Actual zoom value. It should be the same as zoom when zoomToFit==false, it may be different if zoomToFit==true

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  12. val image: ObjectProperty[Image]

    Permalink

    Property containing image to be displayed.

    Property containing image to be displayed. If null the display will be blank (following JavaFX convention)

  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. val roi: ObjectProperty[Option[Rectangle]]

    Permalink

    Optional rectangular ROI to be displayed on the image

  18. def rotation: Double

    Permalink

    Image rotation in degrees.

    Image rotation in degrees. Default value is 0 (no rotation).

  19. def rotation_=(r: Double): Unit

    Permalink
  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  21. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  22. val view: Node

    Permalink

    ScalaFX node in containing this image display UI.

  23. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. val zoom: ObjectProperty[ZoomScale]

    Permalink

    Controls image zoom when zoomToFit is off.

    Controls image zoom when zoomToFit is off. Value of 1 mean no scaling. Values larger than 1 make image larger. Values smaller than 1 make image smaller.

  27. def zoomIn(): Unit

    Permalink

    Zoom in the view.

  28. def zoomOut(): Unit

    Permalink

    Zoom out the view.

  29. val zoomToFit: BooleanProperty

    Permalink

    When set to true the image fits to the size of the available view, maintaining its aspect ratio.

Inherited from AnyRef

Inherited from Any

Ungrouped