From 0fb5dfa31f96d8852223282687a94f94326008b9 Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Wed, 29 Aug 2018 01:51:12 +0100 Subject: [PATCH] move script code to ImageMaker. Add Windows Compatibility Pack. --- .../SmoulderingBeachBall/ImageMaker.fs | 12 ++++++++++-- .../SmoulderingBeachBall.fsproj | 16 +++++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/SmoulderingBeachBall/SmoulderingBeachBall/ImageMaker.fs b/SmoulderingBeachBall/SmoulderingBeachBall/ImageMaker.fs index 2fcba82..d9afa56 100644 --- a/SmoulderingBeachBall/SmoulderingBeachBall/ImageMaker.fs +++ b/SmoulderingBeachBall/SmoulderingBeachBall/ImageMaker.fs @@ -2,11 +2,19 @@ namespace SmoulderingBeachBall module ImageMaker = - let makeImage width height colour = - null + open System.Drawing + //open System.Drawing.Imaging let addOverlay colour image = null let saveImage filePath = null + + let makeImage (width: int) (height: int) (colour: Brush) = + async { + use bitmap = new Bitmap(width, height) + use graphics = Graphics.FromImage(bitmap) + graphics.FillRectangle(Brushes.Coral, new Rectangle(0, 0, bitmap.Width, bitmap.Height)) + return "we" + } \ No newline at end of file diff --git a/SmoulderingBeachBall/SmoulderingBeachBall/SmoulderingBeachBall.fsproj b/SmoulderingBeachBall/SmoulderingBeachBall/SmoulderingBeachBall.fsproj index 3791c98..baad55f 100644 --- a/SmoulderingBeachBall/SmoulderingBeachBall/SmoulderingBeachBall.fsproj +++ b/SmoulderingBeachBall/SmoulderingBeachBall/SmoulderingBeachBall.fsproj @@ -6,9 +6,23 @@ + + 215d64d2-031c-33c7-96e3-61794cd1ee61 + 2 + 4 + tlbimp + + + d37e2a3e-8545-3a39-9f4f-31827c9124ab + 2 + 4 + tlbimp + - + + +