Browse Source

set pen width dynamically.

It takes the images dimensions as the reference point.
master
Craig Oates 6 years ago
parent
commit
9049607887
  1. 10
      SmoulderingBeachBall/InternalServices.fs

10
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

Loading…
Cancel
Save