Skip to content

Commit 300300e

Browse files
committed
SmoothingMode.AntiAlias
1 parent 4777766 commit 300300e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

FractalTrees/Program.fs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
open System.Diagnostics
2+
open System.IO
23

34
[<EntryPoint>]
45
let main argv =
56
printfn "Drawing a tree"
67

7-
let outPath = @"C:\code\FractalTrees\FractalTrees\tree.jpg"
8+
let outfolder = @"C:\code\FractalTrees\FractalTrees\results"
9+
if Directory.Exists outfolder |> not then Directory.CreateDirectory outfolder |> ignore
10+
let outPath = Path.Combine(outfolder, "tree.jpg")
811

912
Tree.drawTree outPath
1013

FractalTrees/Tree.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ let drawTree file =
99
let rnd = new Random()
1010
let img = new Bitmap(size, size)
1111
use g = Graphics.FromImage(img)
12+
g.SmoothingMode <- SmoothingMode.AntiAlias;
1213
let pen = new Pen(Color.Black, 1.f)
1314
g.FillRectangle(new SolidBrush(Color.White), 0, 0, size, size)
1415
g.DrawRectangle(new Pen(Color.Black, 1.f), 0, 0, size - 1, size - 1)

0 commit comments

Comments
 (0)