Browse Source

remove save to stream code in library.

Fix grammar error in validation.
master
Craig Oates 6 years ago
parent
commit
ed77e0c118
  1. 15
      DeathSocket/ImageServices.fs
  2. 2
      DeathSocket/ScratchPad.fsx

15
DeathSocket/ImageServices.fs

@ -3,7 +3,6 @@
open System.Drawing
open System.Drawing.Imaging
open DeathSocket
open System.IO
let createHorizontalLines width height rows =
let interval = width / rows
@ -30,17 +29,3 @@
img.Dispose ()
graphics.Dispose ()
pen.Dispose ()
let drawGridToStream (imgStream: Stream) spec =
let img = Bitmap.FromFile (spec.imagePath)
let graphics = Graphics.FromImage img
let pen = new Pen (spec.colour, width = spec.penWidth)
let horizontalLines =
createHorizontalLines (img.Size.Width) (img.Size.Height) (spec.columns)
let verticalLines = createVerticalLines (img.Size.Height) (spec.columns)
for line in horizontalLines do graphics.DrawLines (pen, line)
for line in verticalLines do graphics.DrawLines (pen, line)
graphics.Dispose ()
pen.Dispose ()
img.Save (imgStream, spec.format)
img.Dispose ()

2
DeathSocket/ScratchPad.fsx

@ -8,6 +8,8 @@ open System
open DeathSocket
open Validation
open ImageServices
open System.Drawing.Imaging
open System.IO
// INITIAL IDEA ===============================================================

Loading…
Cancel
Save