protected void DrawLeaves(ref Canvas imageObject) { for (int i = 0; i < leaves.Count(); i++) { Point leaf = new Point(leaves[i].X, leaves[i].Y); imageObject.DrawElipse(color, leafSize, leaf); } }
protected void DrawBubbleLeaves(ref Canvas imageObject) { Random rnd = new Random(); for (int i = leaves.Count() / 2; i < leaves.Count(); i++) { double scaleFactor = 0.10; int xMinCord = (int)Math.Round(leaves[i].X * (1 - scaleFactor)); int xMaxCord = (int)Math.Round(leaves[i].X + leaves[i].X * scaleFactor); int yMinCord = (int)Math.Round(leaves[i].Y * (1 - scaleFactor)); int yMaxCord = (int)Math.Round(leaves[i].Y + leaves[i].Y * scaleFactor); if (xMinCord < xMaxCord && yMinCord < yMaxCord) { Point leaf = new Point(rnd.Next(xMinCord, xMaxCord + 1), rnd.Next(yMinCord, yMaxCord + 1)); int rndLeafSize = rnd.Next(leafSize); int rndBias = rnd.Next(rndLeafSize); if ((rndLeafSize - rndBias) > 0) { rndLeafSize = rndLeafSize - rndBias; } imageObject.DrawElipse(color, rndLeafSize, leaf); } } }