|
|
|
@ -32,23 +32,6 @@ module ImageMaker =
|
|
|
|
|
| false -> invalidArg "filePath" "Unable to save to the specified location because it does not exist." |
|
|
|
|
| true -> () |
|
|
|
|
|
|
|
|
|
// This function is to be deleted. |
|
|
|
|
let makeImageBase width height colour filepath = |
|
|
|
|
async { |
|
|
|
|
try |
|
|
|
|
validateDimension width |
|
|
|
|
validateDimension height |
|
|
|
|
validateDirectory filepath |
|
|
|
|
use bitmap = new Bitmap(width, height) |
|
|
|
|
use graphics = Graphics.FromImage(bitmap) |
|
|
|
|
graphics.FillRectangle(colour, new Rectangle(0, 0, bitmap.Width, bitmap.Height)) |
|
|
|
|
bitmap.Save(filepath) |
|
|
|
|
return "Image saved." |
|
|
|
|
with |
|
|
|
|
| :? ArgumentException as ex -> return ex.Message |
|
|
|
|
| _ as ex -> return ex.Message |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let private penOffset penWidth = int (penWidth / (float32 2)) |
|
|
|
|
|
|
|
|
|
let private createBorderPath penWidth spec = |
|
|
|
|