|
|
|
@ -19,6 +19,7 @@
|
|
|
|
|
| true -> () |
|
|
|
|
|
|
|
|
|
module Drawing = |
|
|
|
|
open System.Text |
|
|
|
|
|
|
|
|
|
let penOffset penWidth = int (penWidth / (float32 2)) |
|
|
|
|
|
|
|
|
@ -52,6 +53,15 @@
|
|
|
|
|
| Border -> drawBorder graphics pen spec |
|
|
|
|
| Full -> drawFullOverlay graphics pen spec |
|
|
|
|
|
|
|
|
|
let buildFileName spec = |
|
|
|
|
let sb = new StringBuilder () |
|
|
|
|
sb.Append (spec.width.ToString ()) |> ignore |
|
|
|
|
sb.Append "x" |> ignore |
|
|
|
|
sb.Append (spec.height.ToString ()) |> ignore |
|
|
|
|
sb.Append ".png" |> ignore |
|
|
|
|
(sb.ToString ()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let drawImage spec = |
|
|
|
|
let bitmap = new Bitmap (spec.width, spec.height) |
|
|
|
|
let graphics = Graphics.FromImage (bitmap) |
|
|
|
@ -59,7 +69,7 @@
|
|
|
|
|
graphics.FillRectangle (spec.colour, rectangle) |
|
|
|
|
match spec.overlay.IsSome with |
|
|
|
|
| true -> addOverlayToImage graphics spec |
|
|
|
|
| false -> printfn "[INFO.] No overlay specified. Creating image withoutone." |
|
|
|
|
bitmap.Save (spec.filePath) |
|
|
|
|
| false -> printfn "[INFO.] No overlay specified. Creating image without one." |
|
|
|
|
bitmap.Save (Path.Combine (spec.filePath, (buildFileName spec))) |
|
|
|
|
graphics.Dispose() |
|
|
|
|
bitmap.Dispose() |