Browse Source

remove hard coding of pen offset in border path array.

master
Craig Oates 6 years ago
parent
commit
68e65552c1
  1. 15
      SmoulderingBeachBall/ImageMaker.fs

15
SmoulderingBeachBall/ImageMaker.fs

@ -49,16 +49,17 @@ module ImageMaker =
| _ as ex -> return ex.Message
}
let private createBorderPath spec =
[|Point (5, 5);
Point ((spec.width - 5), 5);
Point ((spec.width - 5), (spec.height - 5));
Point (5, (spec.height - 5));
Point (5, 0)|]
let private createBorderPath penWidth spec =
let penOffset = int (penWidth / (float32 2))
[|Point (0, penOffset); // Essentially (0, 0)
Point ((spec.width - penOffset), penOffset);
Point ((spec.width - penOffset), (spec.height - penOffset));
Point (penOffset, (spec.height - penOffset));
Point (penOffset, 0)|]
let private drawImageWithBorder (graphics: Graphics) (pen: Pen) spec =
printfn "[INFO.] Adding border to image..."
let penPath = createBorderPath spec
let penPath = createBorderPath pen.Width spec
graphics.DrawLines (pen, penPath)

Loading…
Cancel
Save