此普通图像转换窗口媒体图像功能
Private Function Bmp2MediaImage(ByVal Resourceimage As System.Drawing.Bitmap) As System.Windows.Media.ImageSource
Dim bmp As System.Drawing.Bitmap = New System.Drawing.Bitmap(Resourceimage)
Dim hBitmap As IntPtr = bmp.GetHbitmap
Dim imageSource As System.Windows.Media.ImageSource = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions)
Return imageSource
End Function
保重