|
|
|
@ -12,7 +12,7 @@ namespace DeathSocket
|
|
|
|
|
open ImageServices |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Uses the information included in spec and creates a gridded image. |
|
|
|
|
/// Uses the information included in spec to create a gridded image. |
|
|
|
|
/// It then asynchronously saves it. |
|
|
|
|
/// Please stick to .bmp, .jpg or .png files. |
|
|
|
|
/// The other (image) file types have not been tested. |
|
|
|
@ -30,7 +30,6 @@ namespace DeathSocket
|
|
|
|
|
/// This is because it is locked whilst in this function. |
|
|
|
|
/// </remarks> |
|
|
|
|
let applyBrushSpecGridAsync (spec: BrushSpec) = |
|
|
|
|
// The spec is to be changed to Brush Spec. |
|
|
|
|
async { |
|
|
|
|
try |
|
|
|
|
validateFilePath spec.originalPath |> ignore |
|
|
|
@ -41,6 +40,23 @@ namespace DeathSocket
|
|
|
|
|
printfn "File could not be found at %s" ex.Message |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Uses the information included in spec to create a gridded image. It |
|
|
|
|
/// then asynchronously saves it. Please stick to .bmp, .jpg or .png |
|
|
|
|
/// files. The other (image) file types have not been tested. |
|
|
|
|
/// </summary> |
|
|
|
|
/// <param name="spec"> |
|
|
|
|
/// The specification used to generate the gridded image. |
|
|
|
|
/// </param> |
|
|
|
|
/// <exeption cref="System.IO.FileNotFoundException"> |
|
|
|
|
/// If the file the grid is being applied to cannot be found, |
|
|
|
|
/// a FileNotFoundException will be thrown. |
|
|
|
|
/// </exception> |
|
|
|
|
/// <remarks |
|
|
|
|
/// Make sure the image, which is having the overlay added to it, |
|
|
|
|
/// is not in use or needed by another program/process. |
|
|
|
|
/// This is because it is locked whilst in this function. |
|
|
|
|
/// </remarks> |
|
|
|
|
let applyRGBAGridAsync (spec: RGBASpec) = |
|
|
|
|
async { |
|
|
|
|
try |
|
|
|
@ -52,15 +68,31 @@ namespace DeathSocket
|
|
|
|
|
printfn "File could not be found at %s" ex.Message |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Creates a Sytsem.Drawing SolidBrush from the individual RGBA values. |
|
|
|
|
/// </summary> |
|
|
|
|
/// <param name="r">The red value.</param> |
|
|
|
|
/// <param name="g">The green value.</param> |
|
|
|
|
/// <param name="b">The blue value.</param> |
|
|
|
|
/// <param name="a">The alpha value.</param> |
|
|
|
|
/// <remarks> |
|
|
|
|
/// Death Socket uses System.Drawing and not System.Media for colours |
|
|
|
|
/// and brushes. |
|
|
|
|
/// </remarks> |
|
|
|
|
let makeSolidBrushFromRGBA r g b a = makeBrushFromRGBA r g b a |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Creates a System.Drawing SolidBrush from a RGBASpec. |
|
|
|
|
/// </summary> |
|
|
|
|
/// <param name="spec"> |
|
|
|
|
///The specification which the brush is made from. |
|
|
|
|
///</param> |
|
|
|
|
/// <remarks> |
|
|
|
|
/// Death Socket uses System.Drawing and not System.Media for colours |
|
|
|
|
/// and brushes. |
|
|
|
|
/// </remarks> |
|
|
|
|
let makeSolidBrushFromRGBASpec spec = makeBrushFromRGBASpec spec |
|
|
|
|
|
|
|
|
|
// let applyCMYKGridAsync -- to be added at a later date. |
|
|
|
|
|
|
|
|
|
// not tested or completed. |
|
|
|
|
//let makeSolidBrushFromCMYK c m y k = "" |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Determines the (Pen) points needed to draw the appropriate number of horizontal lines (I.E. rows). |
|
|
|
|
/// Each item in the array includes a start and end co-ordinate (point) for each line. |
|
|
|
|