Uri uri = new Uri("background.png", UriKind.Relative);
var source = new BitmapImage();
source.CreateOptions = BitmapCreateOptions.None;
System.Windows.Resources.StreamResourceInfo s = Application.GetResourceStream(uri);
source.SetSource(s.Stream);
WriteableBitmap bmp = new WriteableBitmap(source);
原文链接:http://www.wannabedeveloper.com/writeablebitmap-invalid-pointer-from-constructor/