From ee713b76c0caa69daed74ca8abc183c834fff6e8 Mon Sep 17 00:00:00 2001 From: "OPTIMUS-PRIME\\craig" Date: Mon, 12 Nov 2018 05:19:50 +0000 Subject: [PATCH] start add code for skia sharp drawing. --- DeathSocket/DeathSocket.fsproj | 2 +- DeathSocket/ImageServices.fs | 12 ++++++++++++ DeathSocket/ScratchPad.fsx | 9 +++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/DeathSocket/DeathSocket.fsproj b/DeathSocket/DeathSocket.fsproj index b152d9f..8300ee4 100644 --- a/DeathSocket/DeathSocket.fsproj +++ b/DeathSocket/DeathSocket.fsproj @@ -30,7 +30,7 @@ New functions have been added so you can now create a SolidBrush using individua - + diff --git a/DeathSocket/ImageServices.fs b/DeathSocket/ImageServices.fs index 8babd60..b5eab84 100644 --- a/DeathSocket/ImageServices.fs +++ b/DeathSocket/ImageServices.fs @@ -4,6 +4,7 @@ open System.Drawing.Imaging open DeathSocket open ColourServices + open SkiaSharp let createHorizontalLines width height rows = let interval = height / rows @@ -52,3 +53,14 @@ for line in horizontalLines do graphics.DrawLines (pen, line) for line in verticalLines do graphics.DrawLines (pen, line) clone.Save (spec.savePath) + + // You are up to here. Need to draw lines and add image. + let drawSkiaGrid () = + let imageInfo = new SKImageInfo (500, 500) + use surface = SKSurface.Create(imageInfo) + let canvas = surface.Canvas + canvas.Clear (SKColors.White) + let horizontalLines = createHorizontalLines 500 1000 6 + let verticalLines = createVerticalLines 500 1000 9 + + 23 \ No newline at end of file diff --git a/DeathSocket/ScratchPad.fsx b/DeathSocket/ScratchPad.fsx index 9cd1a3f..fd88180 100644 --- a/DeathSocket/ScratchPad.fsx +++ b/DeathSocket/ScratchPad.fsx @@ -41,3 +41,12 @@ let spec: BrushSpec = // 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. *) +