For anyone else that needs a hand working this out, I created two extension methods to convert back and forward between DrawingImage and BitmapSource:
To BitmapSource:
public static BitmapSource ToBitmapSource(this DrawingImage source)
{
DrawingVisual drawingVisual = new DrawingVisual();
DrawingContext drawingContext = drawingVisual.RenderOpen();
drawingContext.DrawImage(source, new Rect(new Point(0, 0), new Size(source.Width, source.Height)));
drawingContext.Close();
RenderTargetBitmap bmp = new RenderTargetBitmap((int)source.Width, (int)source.Height, 96, 96, PixelFormats.Pbgra32);
bmp.Render(drawingVisual);
return bmp;
}
To DrawingImage:
public static DrawingImage ToDrawingImage(this BitmapSource source)
{
Rect imageRect = new Rect(0, 0, source.PixelWidth, source.PixelHeight);
ImageDrawing drawing = new ImageDrawing(source, imageRect);
return new DrawingImage(drawing);
}