Hi all
I am using the below code to assign the barcode to be displayed in a canvas inside rectangle
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);
}
Now i want to save that code as a image file.
Please tell me how to do that
Thank you