From 31d1767202fb9c8e31c92df6175a77ccdf39f2e8 Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Mon, 10 Sep 2018 23:11:41 +0100 Subject: [PATCH] add system.drawing.common to library. Setup the domain file and stubout first public facing function. --- DeathSocket/DeathSocket.fsproj | 5 +++++ DeathSocket/Domain.fs | 12 ++++++++++++ DeathSocket/GridPainter.fs | 6 ++++-- DeathSocket/ScratchPad.fsx | 6 ++---- 4 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 DeathSocket/Domain.fs diff --git a/DeathSocket/DeathSocket.fsproj b/DeathSocket/DeathSocket.fsproj index 3bbfa70..730fba5 100644 --- a/DeathSocket/DeathSocket.fsproj +++ b/DeathSocket/DeathSocket.fsproj @@ -6,8 +6,13 @@ + + + + + diff --git a/DeathSocket/Domain.fs b/DeathSocket/Domain.fs new file mode 100644 index 0000000..7063b4f --- /dev/null +++ b/DeathSocket/Domain.fs @@ -0,0 +1,12 @@ +namespace DeathSocket + + module Domain = + + open System.Drawing + + type ImageSpec = + { filePath: string; + colour: Brush; + penWidth: float32 + rows: int; + columns: int } \ No newline at end of file diff --git a/DeathSocket/GridPainter.fs b/DeathSocket/GridPainter.fs index c80c9e7..b7b930d 100644 --- a/DeathSocket/GridPainter.fs +++ b/DeathSocket/GridPainter.fs @@ -1,5 +1,7 @@ namespace DeathSocket module GridPainter = - // code to go here... - let x = "begin" \ No newline at end of file + + let applyGridToImage spec = + //validateFilePath + 0 \ No newline at end of file diff --git a/DeathSocket/ScratchPad.fsx b/DeathSocket/ScratchPad.fsx index 040769b..f2008bf 100644 --- a/DeathSocket/ScratchPad.fsx +++ b/DeathSocket/ScratchPad.fsx @@ -12,8 +12,7 @@ let img = Bitmap.FromFile (__SOURCE_DIRECTORY__ + "/test-img.jpg") let graphics = Graphics.FromImage img let imgWidth = img.Size.Width let imgHeight = img.Size.Height -(* Keeping it simple here. -Going to just create a 2x2 grid. +(* Keeping it simple here. Going to just create a 2x2 grid. In other words, I'm just halving the width and the height. *) let verticalLine = let midpoint = imgHeight / 2 @@ -31,5 +30,4 @@ let savePath = desktop + "/test-grid.png" // Change this to suit you. img.Save (savePath) img.Dispose graphics.Dispose -pen.Dispose - +pen.Dispose \ No newline at end of file