From 9049607887afbeaed78d908f24c2a67721429a43 Mon Sep 17 00:00:00 2001 From: "OPTIMUS-PRIME\\craig" Date: Mon, 3 Sep 2018 16:46:29 +0100 Subject: [PATCH] set pen width dynamically. It takes the images dimensions as the reference point. --- SmoulderingBeachBall/InternalServices.fs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SmoulderingBeachBall/InternalServices.fs b/SmoulderingBeachBall/InternalServices.fs index 8c7dee1..b2ecfc8 100644 --- a/SmoulderingBeachBall/InternalServices.fs +++ b/SmoulderingBeachBall/InternalServices.fs @@ -24,6 +24,13 @@ let penOffset penWidth = int (penWidth / (float32 2)) + let setPenWidth imgWidth imgHeight = + let width = float32 imgWidth + let height = float32 imgHeight + if (width > height) || (width = height) then + width * (float32 0.05) + else width * (float32 0.05) + let createBorderPath penWidth spec = let offset = penOffset penWidth [|Point (0, offset); // Essentially (0, 0) @@ -49,7 +56,8 @@ let addOverlayToImage graphics spec = let overlay = spec.overlay.Value - let pen = new Pen (overlay.colour, Width = 10.0f) + let pen = + new Pen (overlay.colour, width = (setPenWidth spec.width spec.height)) match overlay.overlayType with | Border -> drawBorder graphics pen spec | Full -> drawFullOverlay graphics pen spec