|
|
|
#load "DomainTypes.fs"
|
|
|
|
#load "InternalServices.fs"
|
|
|
|
#load "PublicServices.fs"
|
|
|
|
|
|
|
|
open System.Drawing
|
|
|
|
open System.Drawing.Imaging
|
|
|
|
open SmoulderingBeachBall.Domain
|
|
|
|
open SmoulderingBeachBall.ImageMaker
|
|
|
|
|
|
|
|
// INITIAL IDEA =======================================================================================================
|
|
|
|
|
|
|
|
let width = 500
|
|
|
|
let height = 500
|
|
|
|
let colour = Brushes.BurlyWood
|
|
|
|
let testPath = "C:/users/craig/desktop/test.png"
|
|
|
|
let draw () =
|
|
|
|
use bmp = new Bitmap(width, height)
|
|
|
|
use gr = Graphics.FromImage(bmp)
|
|
|
|
gr.FillRectangle(colour, new Rectangle(0, 0, bmp.Width, bmp.Height))
|
|
|
|
gr.DrawImage(bmp, 0, 0)
|
|
|
|
bmp.Save(testPath, ImageFormat.Png)
|
|
|
|
|
|
|
|
// IMAGE MAKER ========================================================================================================
|
|
|
|
|
|
|
|
let borderOverlay =
|
|
|
|
{ colour = Brushes.BlueViolet;
|
|
|
|
overlayType = Border }
|
|
|
|
|
|
|
|
let fullOverlay =
|
|
|
|
{ colour = Brushes.Fuchsia;
|
|
|
|
overlayType = Full }
|
|
|
|
|
|
|
|
let imageSpec =
|
|
|
|
{ width = 500;
|
|
|
|
height = 500;
|
|
|
|
colour = Brushes.Yellow;
|
|
|
|
filePath = "C:/users/craig/desktop/test.png";
|
|
|
|
overlay = Some fullOverlay } // Change this to quickly change between border/full overlay or None.
|
|
|
|
|
|
|
|
makeImage imageSpec |> Async.RunSynchronously
|