Browse Source

create wrappers for creating horizontal and vertical line functions.

Rename the ListAllColours to allSystemBrushes.
master
Craig Oates 6 years ago
parent
commit
08af0d1e0d
  1. 12
      DeathSocket/GridPainter.fs
  2. 3
      DeathSocket/ImageServices.fs

12
DeathSocket/GridPainter.fs

@ -22,7 +22,17 @@ namespace DeathSocket
// Needs XML comments.
// Tests have not been written.
let ListAllColours =
let determineHorizontalLines width height rows =
createHorizontalLines width height rows
// Needs XML comments.
// Tests have not been written.
let determineVerticalLines width height columns =
createVerticalLines width height columns
// Needs XML comments.
// Tests have not been written.
let allSystemBrushes =
let properties =
typeof<Brushes>.GetProperties
(BindingFlags.Public ||| BindingFlags.Static)

3
DeathSocket/ImageServices.fs

@ -22,7 +22,8 @@
let pen = new Pen (spec.colour, width = spec.penWidth)
let horizontalLines =
createHorizontalLines (img.Size.Width) (img.Size.Height) (spec.rows)
let verticalLines = createVerticalLines (img.Size.Width) (img.Size.Height) (spec.columns)
let verticalLines =
createVerticalLines (img.Size.Width) (img.Size.Height) (spec.columns)
for line in horizontalLines do graphics.DrawLines (pen, line)
for line in verticalLines do graphics.DrawLines (pen, line)
img.Save (spec.savePath, ImageFormat.Png)

Loading…
Cancel
Save