Death Socket consists of three projects. They are a .Net Standard 2.0 library, a console program and a Test Centre. The purpose of this repository is to provide a way for people to add grids to images.
https://www.craigoates.net/Software/project/13
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
2.1 KiB
56 lines
2.1 KiB
#r @"C:\Users\craig\.nuget\packages\skiasharp\1.60.3\lib\netstandard1.3\SkiaSharp.dll" |
|
#r @"C:\Users\craig\.nuget\packages\skiasharp\1.60.3\lib\net45\SkiaSharp.dll" |
|
|
|
#load "Domain.fs" |
|
#load "Validation.fs" |
|
#load "ColourServices.fs" |
|
#load "ImageServices.fs" |
|
#load "GridPainter.fs" |
|
|
|
open System.Drawing |
|
open System |
|
open DeathSocket |
|
open Validation |
|
open ImageServices |
|
|
|
(* Death Socket Scripts |
|
=============================================================================== |
|
The code in here can be use to create a gridded image without running the CLI. |
|
You can, also, run checks to see what Death Socket is doing when creating |
|
a nerw image. *) |
|
|
|
let desktop = Environment.GetFolderPath (Environment.SpecialFolder.Desktop) |
|
|
|
(* You will need to provide the image at the location specified. It will throw |
|
an exception if the file cannnot be found.*) |
|
let validationTest = validateFilePath (desktop + "/test.jpg") |
|
|
|
(* These are not needed to create an image. There here for you to check the |
|
start and end points of each pen stroke/path. *) |
|
let horizontalLines = createHorizontalLines 1000 500 10 |
|
let verticalLines = createVerticalLines 300 600 10 |
|
|
|
(* You will need to provide the image and specify its load/save location. |
|
Death Socket assumes either JPEG or PNG files so use other files at your own |
|
risk. Cannot guarantee they will work. Also, either in this spec. can be |
|
changed to suit your needs. *) |
|
let spec: BrushSpec = |
|
{ originalPath = desktop + "/test.jpg" |
|
savePath = desktop + "/grid.png" |
|
colour = Brushes.Chartreuse |
|
penWidth = (float32 1) |
|
rows = 10 |
|
columns = 10 } |
|
|
|
// Run this when you have finished building the spec. |
|
GridPainter.applyBrushSpecGridAsync spec |> Async.RunSynchronously |
|
|
|
//***************************************************************************** |
|
|
|
(* Skia Sharp Draft |
|
=============================================================================== |
|
The code below here will eventually be worked into the main codebase or thrown |
|
away. It is here acting as a first draft for integrating the Skia Sharp NuGet |
|
package into Death Socket. *) |
|
|
|
drawSkiaGrid() |