Skip to content
This repository has been archived by the owner on Feb 21, 2021. It is now read-only.

Commit

Permalink
ready for javafx 8
Browse files Browse the repository at this point in the history
  • Loading branch information
luigidr committed Nov 14, 2014
1 parent 5b406c5 commit 88de947
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions FXHelloCV/src/it/polito/elite/teaching/cv/FXHelloCVController.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected void startCamera(ActionEvent event)
if (this.mainApp != null)
{
// get the ImageView object for showing the video stream
final ImageView frameView = (ImageView) mainApp.getRootElement().lookup("#currentFrame");
ImageView frameView = (ImageView) mainApp.getRootElement().lookup("#currentFrame");
// bind an image property with the container for frames
final ObjectProperty<Image> imageProp = new SimpleObjectProperty<>();
frameView.imageProperty().bind(imageProp);
Expand All @@ -77,7 +77,15 @@ public void run()
{
// update the image property => update the frame
// shown in the UI
imageProp.set(grabFrame());
final Image imageToShow = grabFrame();
Platform.runLater(new Runnable()
{
@Override
public void run()
{
imageProp.setValue(imageToShow);
}
});
}
};
this.timer = new Timer();
Expand Down

0 comments on commit 88de947

Please sign in to comment.