2011-04-04 24 views

回答

2

我能夠使用下面的代碼解決我的問題。 msg.ThumbnailSource包含System.Windows.Interop.InteropBitmap對象類型

BitmapSource bmpSource = msg.ThumbnailSource as BitmapSource; 
MemoryStream ms = new MemoryStream(); 
BitmapEncoder encoder = new PngBitmapEncoder(); 
encoder.Frames.Add(BitmapFrame.Create(bmpSource)); 
encoder.Save(ms); 
ms.Seek(0, SeekOrigin.Begin); 


System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(ms); 
0

你能解釋一下問題的背景嗎? InteropBitmap是不是意味着在WPF中渲染遺留位圖元素?似乎你想從win32 - > WPF - > win32。

相關問題