Created
December 5, 2012 21:16
-
-
Save mikebluestein/4219563 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//does the actual coloring | |
void DrawPoints (CGContext dctx) | |
{ | |
dctx.BeginPath (); | |
dctx.MoveTo (Points.First().X, Points.First().Y); | |
dctx.SetLineWidth(swatchSlider.Value); | |
dctx.SetBlendMode (CGBlendMode.Normal); | |
foreach (var crayon in Crayons) { | |
if(crayon.Selected) { | |
if (crayon.Name == "Eraser") { | |
dctx.SetStrokeColor (1.0f, 1.0f, 1.0f, 1.0f); | |
} else { | |
dctx.SetStrokeColor (crayon.R / 255f, crayon.G / 255f, crayon.B / 255f, 1f); | |
} | |
dctx.SetLineCap (CGLineCap.Round); | |
} | |
} | |
//set fill color with current crayons | |
foreach (var point in Points) { | |
dctx.AddLineToPoint(point.X, point.Y); | |
} | |
dctx.StrokePath(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment