Browse Source

add system.drawing.common to library.

Setup the domain file and stubout first public facing function.
master
Craig Oates 6 years ago
parent
commit
31d1767202
  1. 5
      DeathSocket/DeathSocket.fsproj
  2. 12
      DeathSocket/Domain.fs
  3. 6
      DeathSocket/GridPainter.fs
  4. 6
      DeathSocket/ScratchPad.fsx

5
DeathSocket/DeathSocket.fsproj

@ -6,8 +6,13 @@
<ItemGroup>
<Content Include="test-img.jpg" />
<Compile Include="Domain.fs" />
<Compile Include="GridPainter.fs" />
<None Include="ScratchPad.fsx" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="4.5.0" />
</ItemGroup>
</Project>

12
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 }

6
DeathSocket/GridPainter.fs

@ -1,5 +1,7 @@
namespace DeathSocket
module GridPainter =
// code to go here...
let x = "begin"
let applyGridToImage spec =
//validateFilePath
0

6
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
Loading…
Cancel
Save