Private Function ImageSourceConvertToGDI() As System.Drawing.Image
Dim stream As New MemoryStream() '内存流
Dim encoder As New System.Windows.Media.Imaging.BmpBitmapEncoder() '图形编码器
encoder.Frames.Add(System.Windows.Media.Imaging.BitmapFrame.Create(ImageSourceObj)) 'ImageSource对象
encoder.Save(stream) '写入内存流
stream.Flush() '刷新
Return System.Drawing.Image.FromStream(stream) ‘传回Drawing.Image
End Function
Dim stream As New MemoryStream() '内存流
Dim encoder As New System.Windows.Media.Imaging.BmpBitmapEncoder() '图形编码器
encoder.Frames.Add(System.Windows.Media.Imaging.BitmapFrame.Create(ImageSourceObj)) 'ImageSource对象
encoder.Save(stream) '写入内存流
stream.Flush() '刷新
Return System.Drawing.Image.FromStream(stream) ‘传回Drawing.Image
End Function