From c38c4b4d5d2ef999f53caf7a32f96ffc6c706ded Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Mon, 31 Dec 2018 15:44:03 +0000 Subject: [PATCH] update ScratchPad. --- DeathSocket/ImagePrep.fs | 4 ++++ DeathSocket/ScratchPad.fsx | 24 +++--------------------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/DeathSocket/ImagePrep.fs b/DeathSocket/ImagePrep.fs index 799d454..25ec5f0 100644 --- a/DeathSocket/ImagePrep.fs +++ b/DeathSocket/ImagePrep.fs @@ -31,6 +31,8 @@ |> determineLineScale lineWidth thickness + (* SkiaSharp Functions + ======================================================================== *) let createSKHorizontalLines width height rows = let interval = float32 (height / rows) [|for point in 1 .. (rows - 1) -> @@ -49,6 +51,8 @@ use bitmap = SKBitmap.Decode (skStream) (bitmap.Width, bitmap.Height) + (* System.Drawing Functions + ======================================================================== *) let createHorizontalLines width height rows = let interval = height / rows [| for point in 1 .. (rows - 1) -> diff --git a/DeathSocket/ScratchPad.fsx b/DeathSocket/ScratchPad.fsx index 274d958..399af83 100644 --- a/DeathSocket/ScratchPad.fsx +++ b/DeathSocket/ScratchPad.fsx @@ -6,6 +6,7 @@ #load "Domain.fs" #load "ValidationServices.fs" #load "ColourServices.fs" +#load "ImagePrep.fs" #load "ImageServices.fs" #load "GridPainter.fs" @@ -13,6 +14,7 @@ open System open System.Drawing open SkiaSharp open ValidationServices +open ImagePrep open ImageServices open DeathSocket @@ -41,33 +43,13 @@ let skVerticalLines = createSKVerticalLines 120 450 22 (* You will need to provide the image and specify its load/save location. Death Socket assumes either JPEG or PNG files.*) -// Internal function call. Not accessible outside this project. -let skiaSharpDimensions = - determineSkiaDimensions (desktop + "/test.jpg") - -// Internal function call. Not accessible outside this project. -let systemDrawingDimensions = - determineSystemDrawingDimensions (desktop + "/test.jpg") - -// Internal function calls. Not accessible outside this project. -let width = double (fst skiaSharpDimensions) -let width2 = double (fst systemDrawingDimensions) - -// Internal function calls. Not accessible outside this project. -let height = double (snd skiaSharpDimensions) -let height2 = double (snd systemDrawingDimensions) - -// Public function for the internal ones above. let dimensions = //SkiaSharp (desktop + "/test.jpg") SystemDrawing (desktop + "/test.jpg") |> GridPainter.determineImageDimensions -let width3 = fst dimensions -let height3 = snd dimensions - // Change the line thickness (the last parameter) to whatever you want. -let scaledPen = GridPainter.scaleLineThickness width height 8.0 +let scaledPen = GridPainter.scaleLineThickness (100, 100) dimensions 8.0 // Brush Specification (uses System.Drawing) Brush ({ originalPath = desktop + "/test.jpg"