I've drawn ellipse over canvas, now how can I save it as an image. I know you cannot directly save canvas as an image and neither you can take screenshot. I am working in C#/xaml. Below is my code for drawing ellipse over canvas.
private void canvasDraw_PointerMoved(object sender, PointerRoutedEventArgs e)
{
if (drawing)
{
PointerPoint current = e.GetCurrentPoint((UIElement)sender);
// Line line = new Line() { X1 = start.Position.X, Y1 = start.Position.Y, X2 = current.Position.X, Y2 = current.Position.Y };
//line.Stroke = new SolidColorBrush(Colors.Black);
Ellipse circle = new Ellipse();
circle.SetValue(Canvas.LeftProperty, current.Position.X);
circle.SetValue(Canvas.TopProperty, current.Position.Y);
circle.Height = 20;
circle.Width = 20;
circle.Fill = currentBrush;
circle.Opacity = 0.7;
circle.SetValue(Canvas.ZIndexProperty,1);
canvasDraw.Children.Add(circle);
}
}
Edit : I am able to save the image by using InkManager. I stored every Ellipse in inkmanager and called SaveAsync method but the final issue is the image comes in black for example if I draw red ellipse the saved image has black ellipse.