X-Git-Url: http://git.euphorik.ch/?p=master-thesis.git;a=blobdiff_plain;f=Parasitemia%2FParasitemiaUI%2FGUI.fs;h=40b3965e94cc2e892d628c7efb1afe4cbc15cae1;hp=c85017fa1fd581c1eb9ae369f52c6597fffeaedc;hb=ef07574f9326af515348bfbd8a0cf606ec337c3a;hpb=daead318f59321a575ab7a1f0c0d89860f78ae81 diff --git a/Parasitemia/ParasitemiaUI/GUI.fs b/Parasitemia/ParasitemiaUI/GUI.fs index c85017f..40b3965 100644 --- a/Parasitemia/ParasitemiaUI/GUI.fs +++ b/Parasitemia/ParasitemiaUI/GUI.fs @@ -82,16 +82,23 @@ let run (defaultConfig : Config) (fileToOpen : string option) = statusMessageTimer.Start () let highlightRBC (rbc : RBC) (highlight : bool) = - let strokeThickness = frameStrokeThickness () + let highlightRBCFrame (rbcFrame : RBCFrame) (strokeThickness : float) = + if highlight then + rbcFrame.border.StrokeThickness <- 3. * strokeThickness + if not rbc.infected && not rbc.setManually && not displayHealthy then rbcFrame.Opacity <- 1. + else + rbcFrame.border.StrokeThickness <- strokeThickness + if not rbc.infected && not rbc.setManually && not displayHealthy then rbcFrame.Opacity <- 0. - for rbcFrame in (win.stackRBC.Children |> Seq.cast).Concat(win.canvasCurrentImage.Children |> Seq.cast) do + for rbcFrame in win.stackRBC.Children |> Seq.cast do if (rbcFrame.Tag :?> RBC) = rbc then - if highlight then - rbcFrame.border.StrokeThickness <- 3. * strokeThickness - if not rbc.infected && not rbc.setManually && not displayHealthy then rbcFrame.Opacity <- 1. - else - rbcFrame.border.StrokeThickness <- strokeThickness - if not rbc.infected && not rbc.setManually && not displayHealthy then rbcFrame.Opacity <- 0. + highlightRBCFrame rbcFrame 1. + + let strokeThicknessCanvas = frameStrokeThickness () + + for rbcFrame in win.canvasCurrentImage.Children |> Seq.cast do + if (rbcFrame.Tag :?> RBC) = rbc then + highlightRBCFrame rbcFrame strokeThicknessCanvas let zoomToRBC (rbc : RBC) = win.scrollViewCurrentImage.ScrollToHorizontalOffset (rbc.center.X * currentScale - win.scrollViewCurrentImage.ViewportWidth / 2. + win.borderCurrentImage.BorderThickness.Left)