org.scalafx.extras.image
package org.scalafx.extras.image
Members list
Type members
Classlikes
class ImageDisplay
Displays an image view with the ability to zoom in, zoom out, zoom to fit. It can be also automatically resized to the parent's size. When zoomToFit is set to true, the image is sized to fit the parent scroll pane.
Displays an image view with the ability to zoom in, zoom out, zoom to fit. It can be also automatically resized to the parent's 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 JFXApp3 {
override def start(): Unit = {
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
}
}
}
}
}
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
In this article