Saving a WPF canvas as an image

前端 未结 4 554
天命终不由人
天命终不由人 2020-12-16 00:34

I was following this article and I got my canvas to be saved, however, I want to extend the code\'s functionality and save a particular part of my canvas as an image, rather

4条回答
  •  心在旅途
    2020-12-16 01:15

    Looking at the link you posted, obviously you can choose the rendered target coordinates here.

    RenderTargetBitmap rtb = new RenderTargetBitmap((int)rect.Right,
         (int)rect.Bottom, 96d, 96d, System.Windows.Media.PixelFormats.Default);
    

提交回复
热议问题