Skip to content

Commit

Permalink
SmoothingMode.AntiAlias
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpi committed Dec 26, 2020
1 parent 4777766 commit 300300e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion FractalTrees/Program.fs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
open System.Diagnostics
open System.IO

[<EntryPoint>]
let main argv =
printfn "Drawing a tree"

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

Tree.drawTree outPath

Expand Down
1 change: 1 addition & 0 deletions FractalTrees/Tree.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ let drawTree file =
let rnd = new Random()
let img = new Bitmap(size, size)
use g = Graphics.FromImage(img)
g.SmoothingMode <- SmoothingMode.AntiAlias;
let pen = new Pen(Color.Black, 1.f)
g.FillRectangle(new SolidBrush(Color.White), 0, 0, size, size)
g.DrawRectangle(new Pen(Color.Black, 1.f), 0, 0, size - 1, size - 1)
Expand Down

0 comments on commit 300300e

Please sign in to comment.