1

我正在使用下面的代码在图像上写文本。但我无法保存它。有没有办法可以将更改保存到新图像或覆盖现有图像?

        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();

        };
4

1 回答 1

1

您可以通过调用SaveJpeg()WriteableBitmap 来保存生成的图像。请参阅http://msdn.microsoft.com/en-us/library/windowsphone/develop/system.windows.media.imaging.extensions.savejpeg(v=vs.105).aspx

于 2013-03-04T17:45:58.183 回答