不知道BitMapSource是什么类型,只能给一些可能有帮助的提示
Bitmap bm = new Bitmap();
pictureBox1.Image = Image.FromHbitmap(bm.GetHbitmap());
// Define parameters used to create the BitmapSource.
PixelFormat pf = PixelFormats.Bgr32;
int width = 200;
int height = 200;
int rawStride = (width * pf.BitsPerPixel + 7) / 8;
byte[] rawImage = new byte[rawStride * height];
// Initialize the image with data.
Random value = new Random();
value.NextBytes(rawImage);
// Create a BitmapSource.
BitmapSource bitmap = BitmapSource.Create(width, height,
96, 96, pf, null,
rawImage, rawStride);
// Create an image element;
Image myImage = new Image();
myImage.Width = 200;
// Set image source.
myImage.Source = bitmap;
http://msdn.microsoft.com/zh-cn/library/vstudio/system.windows.media.imaging.bitmapsource(v=vs.110).aspx