master
Craig Oates 4 years ago
parent
commit
92567c6ff5
  1. 12
      Using-Death-Socket-in-Your-Project.md

12
Using-Death-Socket-in-Your-Project.md

@ -18,11 +18,11 @@ Brush (buildSpec imgPath numRows numColumns pWidth colour newPath)
For a more real-world example (with extra cruft), please read the `add-grid` function in "Commands.fs". This file is part of the DeathSocketCLI project and the link for it is as follows:
- [Add-Grid example in Commands.fs](https://git.abbether.net/craig.oates/Death-Socket/blob/master/DeathSocketCLI/Commands.fs)
- [Add-Grid example in Commands.fs](https://git.abbether.net/craig.oates/Death-Socket/src/branch/master/DeathSocketCLI/Commands.fs)
**Note:** Most of the "add-grid" functions will (by default) save the gridded image for you (using the save location part of the image specification). If you prefer, D.S. can create a gridded image and not save it. When that happens, it will return it as an in-memory buffer. If you are not sure on which function does what, use Visual Studio's intellisense. It will help you identify those which saves the image for you and those which return an in-memory buffer. Having said that, you are free to read the source code for these functions with the following link:
- [GridPainter.fs](https://git.abbether.net/craig.oates/Death-Socket/blob/master/DeathSocket/GridPainter.fs)
- [GridPainter.fs](https://git.abbether.net/craig.oates/Death-Socket/src/branch/master/DeathSocket/GridPainter.fs)
## A Note about the Graphics Libraries Used by Death Socket (I.E. The System's Flow)
@ -52,8 +52,8 @@ The above image shows the flow of a typical code-base using D.S. Looking at this
To help you get started, I recommend you keep the following two files open when writing your code:
- [GridPainter.fs](https://git.abbether.net/craig.oates/Death-Socket/blob/master/DeathSocket/GridPainter.fs)
- [Domain.fs](https://git.abbether.net/craig.oates/Death-Socket/blob/master/DeathSocket/Domain.fs)
- [GridPainter.fs](https://git.abbether.net/craig.oates/Death-Socket/src/branch/master/DeathSocket/GridPainter.fs)
- [Domain.fs](https://git.abbether.net/craig.oates/Death-Socket/src/branch/master/DeathSocket/Domain.fs)
### Domain Module
@ -127,7 +127,7 @@ The purpose of this function is to determine the dimensions of the image at the
Instead of repeating all the code in "Domain.fs", I recommend you take a look at the file yourself. The link for that is as follows:
- [Domain.fs](https://git.abbether.net/craig.oates/Death-Socket/blob/master/DeathSocket/Domain.fs)
- [Domain.fs](https://git.abbether.net/craig.oates/Death-Socket/src/branch/master/DeathSocket/Domain.fs)
I have documented the code within the file using XML comments. So, you should get intellisense overlays when you use Visual Studio or Visual Studio Code.
@ -148,7 +148,7 @@ Within `GridPainter`, you will find ten functions, which are as follows:
Instead of repeating the code from that file here, I recommend you open up "GridPainter.fs" in a separate tab. Every function has XML comments explaining what they do. So, you should have intellisense in Visual Studio and Visual Studio Code. If you read "GridPainter.fs", you will notice I have marked out areas called "SkiaSharp Functions" and "System.Drawing Functions". This should help you denote which function use which graphics library. If you are unsure which function uses which library, you can refer back to the XML comments/intellisense. As a general rule, if a function has "SK" in its name, it uses *SkiaSharp*. If it does not, it uses *System.Drawing*. The link for GridPainter.fs is as follows:
- [GridPainter.fs](https://git.abbether.net/craig.oates/Death-Socket/blob/master/DeathSocket/GridPainter.fs)
- [GridPainter.fs](https://git.abbether.net/craig.oates/Death-Socket/src/branch/master/DeathSocket/GridPainter.fs)
In an attempt to get you up and running, I have provided the following table. It shows what graphics library is used by each function and should help alongside the Intellisense in Visual Studio.

Loading…
Cancel
Save