我正在使用下面的代码在图像上写文本。但我无法保存它。有没有办法可以将更改保存到新图像或覆盖现有图像?
BitmapImage img = new BitmapImage(new Uri(@"\DefaultImage.jpg", UriKind.Relative));
img.CreateOptions = BitmapCreateOptions.None;
img.ImageOpened += (s, e) =>
{
WriteableBitmap wbitmap = new WriteableBitmap((BitmapImage)s);
TextBlock textBlock = new TextBlock();
textBlock.Text = stringToRender;
wbitmap.Render(textBlock, null);
wbitmap.Invalidate();
};