for (int i = 0; i < len; i++) { Rectangle rect = new Rectangle(); rect.Height = 200; if (currentColor == 0) { currentColor = 1; rect.Fill = new SolidColorBrush(Colors.Black); } else { currentColor = 0; rect.Fill = new SolidColorBrush(Colors.White); } Canvas.SetLeft(rect, currentPos); Canvas.SetTop(rect, currentTop); if (outputString[i] == 't') { rect.Width = thinWidth; currentPos += thinWidth; } else if (outputString[i] == 'w') { rect.Width = thickWidth; currentPos += thickWidth; } mainCanvas.Children.Add(rect); }
Canvas
System.Windows.Media.Imaging.RenderTargetBitmap
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)