frame.manuallyAdded.Fill <- color
frame.border.Stroke <- color
- let frameStrokeThickness (averageRBCSize : float) =
- max 1. (averageRBCSize / 60.)
+ let frameStrokeThickness () =
+ state.CurrentImage |> Option.map (fun img -> max 1. (img.AverageRBCSize / 100.)) |> Option.defaultValue 1.
- let frameFontSize (averageRBCSize : float) =
- max 1. (averageRBCSize / 6.)
+ let frameFontSize () =
+ state.CurrentImage |> Option.map (fun img -> max 1. (img.AverageRBCSize / 6.)) |> Option.defaultValue 1.
let createRBCFrameFromExisting (srcImg : SourceImage) (rbc : RBC) (frame : RBCFrame) (frameThickness : float) (fontSize : float) (isTextBelow : bool) : RBCFrame =
frame.Visibility <- Visibility.Visible
statusMessageTimer.Start ()
let highlightRBC (rbc : RBC) (highlight : bool) =
- // let rbc = frame.Tag :?> RBC
- // Find the two frames in previews and current image.
+ let strokeThickness = frameStrokeThickness ()
for rbcFrame in (win.stackRBC.Children |> Seq.cast<RBCFrame>).Concat(win.canvasCurrentImage.Children |> Seq.cast<RBCFrame>) do
if (rbcFrame.Tag :?> RBC) = rbc then
if highlight then
- rbcFrame.border.StrokeThickness <- 3. * rbcFrame.border.StrokeThickness
+ rbcFrame.border.StrokeThickness <- 3. * strokeThickness
if not rbc.infected && not rbc.setManually && not displayHealthy then rbcFrame.Opacity <- 1.
else
- rbcFrame.border.StrokeThickness <- rbcFrame.border.StrokeThickness / 3.
+ rbcFrame.border.StrokeThickness <- strokeThickness
if not rbc.infected && not rbc.setManually && not displayHealthy then rbcFrame.Opacity <- 0.
let zoomToRBC (rbc : RBC) =
match state.CurrentImage with
| Some srcImg ->
let mutable currentCanvas = 0
- let strokeThickness = frameStrokeThickness srcImg.AverageRBCSize
- let fontSize = frameFontSize srcImg.AverageRBCSize
+ let strokeThickness = frameStrokeThickness ()
+ let fontSize = frameFontSize ()
for rbc in srcImg.RBCs do
let frame =
if currentCanvas < win.canvasCurrentImage.Children.Count then