Browse Source

update ScratchPad.

master
Craig Oates 5 years ago
parent
commit
c38c4b4d5d
  1. 4
      DeathSocket/ImagePrep.fs
  2. 24
      DeathSocket/ScratchPad.fsx

4
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) ->

24
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"

Loading…
Cancel
Save