I am trying to save an image from ink canvas however it does not create any file after saving, this is my code
RenderTargetBitmap rtb = new RenderTargetBitmap(
(int)canvas.Width, (int)canvas.Height, 0, 0, PixelFormats.Default);
rtb.Render(this.canvas);
JpegBitmapEncoder encoder = new JpegBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(rtb));
using(var file = new FileStream(@"C:est.jpg", FileMode.Create))
{
encoder.Save(file);
}
however it does not create any file even when I change the directory. No exceptions is invoked and no errors are shown. The code just ran normally without any problem but the file meant to be generated is not there.
See Question&Answers more detail:os