From 47071e7b8a62b597c8121a2d8a4a1cd1a171acf1 Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Wed, 29 Aug 2018 01:11:42 +0100 Subject: [PATCH] add initial sketching out of image creation in scratch pad. --- .../SmoulderingBeachBall/ScratchPad.fsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/SmoulderingBeachBall/SmoulderingBeachBall/ScratchPad.fsx b/SmoulderingBeachBall/SmoulderingBeachBall/ScratchPad.fsx index e02abfc..f15e156 100644 --- a/SmoulderingBeachBall/SmoulderingBeachBall/ScratchPad.fsx +++ b/SmoulderingBeachBall/SmoulderingBeachBall/ScratchPad.fsx @@ -1 +1,15 @@ - +#load "ImageMaker.fs" + +open System.Drawing +open System.Drawing.Imaging + +let width = 500 +let height = 500 +let colour = Brushes.BurlyWood +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("C:/users/craig/desktop/test.png", ImageFormat.Png) +let result = draw ()